[GRASS-user] convert r.report output to spreadsheet format

Jonah Duckles jonahd at gmail.com
Tue Feb 24 10:03:36 EST 2009


Maning,

Depends on what you are doing with r.report, but you can often use r.stats
instead, to output a csv file (look at docs for r.stats if you want percent
or cell counts, my example assumes area counts).
r.stats -an fs="," input=raster1,raster2

If you need to do a unit conversion ie m^2 to acres, use awk:
r.stats -an input=raster1,raster2 | awk -F, '{acres=$3*0.00024710538; print
$1" "$2" "acres}' > output.txt

Jonah Duckles
Senior Analyst
Lanworth


On Tue, Feb 24, 2009 at 5:37 AM, maning sambale
<emmanuel.sambale at gmail.com>wrote:

> Hi,
>
> Looking for tips in "transforming" r.report output into a
> "spreadsheet" like format.
>
> --
> cheers,
> maning
> ------------------------------------------------------
> "Freedom is still the most radical idea of all" -N.Branden
> wiki: http://esambale.wikispaces.com/
> blog: http://epsg4253.wordpress.com/
> ------------------------------------------------------
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20090224/a162d59e/attachment.html


More information about the grass-user mailing list