<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 05/31/2012 07:23 PM, Daniel Lee wrote:
<blockquote
cite="mid:CAJHDHfq4fsgMiMDizJwV6D6y78MS1OX5H6_YgjZjKzqq2MQJCg@mail.gmail.com"
type="cite">I'll have to defer that to the list, I'm not too good
at bash scripting:
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
style="">Well, yes I was thinking to that but I don't know
exactly how to do it. I mean, till now with:</span><br
style="">
<span style="">g.mlist -r type=rast pattern='fill_mnat'</span><br
style="">
<span style="">I have managed to see all rasters that I want to
export (fill_mnat - is contained in the middle of the name of
all files for export).</span><br style="">
<span style="">Next I think I have to run something like: </span><br
style="">
<span style="">for map in g.mlist -r type=rast
pattern='fill_mnat' do r.out.arc input=$map output='basemap
$map .asc' done but nothing happens. Is this the correct
command line?</span></blockquote>
<br>
</blockquote>
<br>
Try like this:<br>
<br>
RASTS=`g.mlist rast pat="*fill_mnat*"`<br>
for r in $RASTS; do<br>
echo "Processing raster $r"<br>
g.region rast=$r<br>
r.out.asc $r out=$r.asc<br>
done<br>
<br>
Note the backticks (`) in the first line.<br>
Also, be aware that some software reads the asc header as cell
*centers* and some as cell *corners*. GRASS outputs each pixel to
the asc file as cell corners. If you need it as centers, add a '-c'
to the r.out.asc command.<br>
<br>
<blockquote
cite="mid:CAJHDHfq4fsgMiMDizJwV6D6y78MS1OX5H6_YgjZjKzqq2MQJCg@mail.gmail.com"
type="cite">
This mail was received via Mail-SeCure System.<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
grass-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/grass-user">http://lists.osgeo.org/mailman/listinfo/grass-user</a>
This mail was received via Mail-SeCure System.
</pre>
</blockquote>
<br>
</body>
</html>