[GRASS-user] Export multiple files with r.out.arc

David Montoya jdmonto0 at gmail.com
Thu May 31 09:19:25 PDT 2012


On Thu, May 31, 2012 at 9:40 AM, Rosca Bogdan <roscao at gmail.com> wrote:

> Hello!
> How can I export multiple raster files created with r.basin with r.out.arc
> ( I need them to have *.asc extension). Is there a command line to do this
> in batch mode because I have around 170 files and it is a bit tedious.
> Please help.
> Thank you,
> Bogdan Rosca
>

The only way that I know, it's with a script. Here is an example that you
can use:

1. Create a plain text with the names of your input maps, line by line:
map_name_1
map_name_2
map_name_3
..

If your maps have a pattern, like the example above, you can use the next
line to create the file:

g.mlist type=rast pattern=map_name* > names

2. This a little script that would be useful for you purpose. Just put it
on the terminal

i=1
for VAR in `awk '{print}' names`
do
    r.out.arc in=$VAR out=$VAR"_arc_"$i
    i=`expr $i + 1`
done

I hope it helps you


>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
>


-- 
David Montoya González
Ing. Forestal, Universidad Nacional de Colombia
Laboratorio de Sistemas Complejos, UNAL Medellin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20120531/77a3c9db/attachment-0001.html>


More information about the grass-user mailing list