[GRASS-user] Re: Importing multiple files with r.in.xyz

Micha Silver micha at arava.co.il
Wed Aug 11 06:12:27 EDT 2010


Hello Hanlie:
First I must thank Saber for pointing you to my blog.

Regarding your r.in.xyz question, If you decide to make the jump to 
Linux, then the scripting capabilities in a bash shell will give you a 
real "eye-opener". As others have mentioned, you can loop thru a whole 
directory of files and run a grass command for each with something like:

for infile in *.txt; do
     # get the base name of the txt file without the .txt extension
     # Note that the 2nd parameter for basename includes the dot '.'
     outrast=`basename ${infile} .txt`
     r.in.xyz -s in=${infile} fs=, out=${outrast}
done

I'm sure it's doable also in a windows cmd shell. And there are other 
ways to get the list of files into a loop. If you'd like to see a 
sample, check this older blog post:
http://www.surfaces.co.il/?p=241

Regards,
Micha



On 11/08/2010 12:16, razmjooeis at faunalia.co.uk wrote:
> Hanlie
>
> You might find this useful:
> http://www.surfaces.co.il/?p=578
>
> It's in qgis, but still you can use GRASS plugin to interact with your
> datasets.
>
> Cheers
> Saber
>
>
>    
>> Thanks for the reply. I'll try that if I don't manage with the Linux
>> version.
>>
>> However, previously when I worked with the SVN version, I was advised
>> to rather use the stable version.
>>
>> 2010/8/10, Helmut Kudrnovsky<hellik at web.de>:
>>      
>>>> Hi,
>>>>
>>>> I'm working with WinGRASS 6.4RC6 on Win XP
>>>>          
>>> [...]
>>>
>>> please try also the latest nightly builds of WinGrass64svn
>>> (http://josef.fsv.cvut.cz/wingrass/grass64/),
>>> because release candidate 6 of Grass64 is now a little bit outdated.
>>>
>>> best regards
>>> Helmut
>>> ___________________________________________________________
>>> Neu: WEB.DE De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
>>> Jetzt De-Mail-Adresse reservieren: https://produkte.web.de/go/demail02
>>>
>>>        
>> _______________________________________________
>> grass-user mailing list
>> grass-user at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>
>>      
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> This mail was received via Mail-SeCure System.
>
>
>    


-- 
Micha Silver
http://www.surfaces.co.il/
Arava Development Co.  +972-52-3665918



More information about the grass-user mailing list