[GRASS-dev] Get min and max value of the ranges reported by r.stats in case of fp input maps

Paulo van Breugel p.vanbreugel at gmail.com
Tue Nov 20 11:39:18 PST 2012


Thanks, much appreciated. I think I sort of understand the syntax now I see
it, but I definitely need to get more into this.


On Tue, Nov 20, 2012 at 7:09 PM, Glynn Clements <glynn at gclements.plus.com>wrote:

>
> Paulo van Breugel wrote:
>
> > Is there a way to get the minimum and maximum values separately for each
> of
> > the ranges reported by fp in case of fp input maps?
> >
> > I could use e.g., awk to separate the columns, but the problem is with
> > negative values, like in the example below:
> >
> > -1--2 | 5
> > -2-0 | 10
> > 0-1 | 3
> >
> > The minus sign and the dash to separate the minimum and maximum value of
> > the range are the same character so separating by separator is not that
> > straightforwards (or maybe / hopefully I am missing something obvious).
>
> A '-' is a minus sign if it occurs at the beginning of the string or
> immediately following another '-', otherwise it's a dash.
>
> The following regexp should match the above syntax correctly:
>
> ^\(-\?[0-9]\+\)-\(-\?[0-9]\+\) *| *\([0-9]\+\)  # basic RE syntax
> ^(-?[0-9]+)-(-?[0-9]+) *\| *([0-9]+)            # extended RE syntax
>
> --
> Glynn Clements <glynn at gclements.plus.com>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20121120/7e9c3a47/attachment.html>


More information about the grass-dev mailing list