[GRASS-user] occurrence of attributes in vektortable

Tom Russo russo at bogodyn.org
Fri Mar 7 12:20:07 EST 2008


On Fri, Mar 07, 2008 at 03:35:17PM +0100, we recorded a bogon-computron collision of the <nikos.alexandris at felis.uni-freiburg.de> flavor, containing:
> 
> On Fri, 2008-03-07 at 08:55 -0500, Patton, Eric wrote:
> > On Fri, 2008-03-07 at 07:17 -0500, Patton, Eric wrote:
> > >>>how can i get a list of all different occurences in a column of an 
> > >>>attributetable.
> > >> 
> > >> v.db.select map=mapname column=columnname | uniq (for vector with a connected attribute table)
> > >>
> > 
> > >It doesn't work for me. What am I doing wrong?
> > 
> > Omit the -u flag from uniq.
> 
> Hmmm? I tried but... :
> 
> v.db.select map=TrainingSamples column=clccode_le | uniq
> clccode_le
> 3
> 334
> 3
> 332
> 334
[...]

"uniq" only prints unique lines if duplicated lines are adjacent --- so
the input to uniq has to be sorted first.  The earlier example using
"sort -u" is the way to go when the input list isn't sorted, as in this
case.

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236 AHTB#1 http://kevan.org/brain.cgi?DDTNM
"And, isn't sanity really just a one-trick pony anyway? I mean all you get is
 one trick, rational thinking, but when you're good and crazy, oooh, oooh,
 oooh, the sky is the limit!"  --- The Tick


More information about the grass-user mailing list