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

Hermann Peifer peifer at gmx.eu
Wed Aug 11 09:31:13 EDT 2010


On 11/08/2010 15:07, Hanlie Pretorius wrote:
>
> This works nicely, except that my input files have names like:
> 3B42.000201.0.6.nc.lieb.txt
> 3B42.000201.3.6.nc.lieb.txt
>
> and I want the output rasters to be named
> 3B42.000201.0.6
> 3B42.000201.3.6
>
> In fact, it would be best if they could be named:
> 0201.0.6
> 0201.3.6
>
> I'm struggling with this string manipulation in the shell scripting language.
>
>

In bash, you could do:

for infile in *.txt ; do r.in.xyz in=${infile} out=${infile:7:8} ... ; done

Hermann


More information about the grass-user mailing list