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

Nikos Alexandris nikos.alexandris at felis.uni-freiburg.de
Tue Aug 10 10:48:46 EDT 2010


Hanlie Pretorius wrote:

> I'm working with WinGRASS 6.4RC6 on Win XP.

[...]

> Not sure what a 'reasonable output name is', so I run it as shown
> below and get the following error:
> -----
> cat F:\Hanlie\UCT\M.Sc.\Data\TRMM\2000\02_Februrarie\*.txt| r.in.xyz
> -s in=- fs=, out=test
> cat: F:\Hanlie\UCT\M.Sc.\Data\TRMM\2000\02_Februrarie\*.txt: No such
> file or directory
> -----

[...]

 
> How do I get this to work?

No window$ user here but I think it has to do with the "*.txt" part. How do 
wildcard patterns work in these cases (under window$) might be the question to 
the answer you are looking for.

> And how would I get the output filenames to
> be related to the input filenames? For example, if the input filename
> is 3B42.000201.0.6.nc.lieb.txt, then I want the output raster to be
> named '3B42.000201.0.6'.

Building a for loop to treat one file at a time should do it. In pseudo-code 
or in bash this would look like (given all and only .txt files of interest are 
in a (the current) directory) :

--%<---
for FILE in *.txt ; do

    <whatever has to be done for one file! + removing unwanted parts of the 
filename using string manipulation tools such as "tr" and "cut">

done
-->%---

How would this work in windows? Look in past threads, there must be something 
or wait till the experts chime-in. Sorry for the indirect answers. 

Cheers, Nikos


More information about the grass-user mailing list