countsort − counts all subsequent identical lines from stdin |
countsort [ -n ] |
countsort reads each lines from stdin. While subsequent lines are identical countsort increases an internal count, when a different line occurs, the previous last line is output prepended with the count of occurences. The process starts over with the new different line. A typical use is to count occurences from a sorted file. |
-n |
prepends each output line with it’s own occurence order (1 for the first, 2 for the second ...) |
none. |
> echo ’a.a.a.b.b.c.c.c.c’ | tr ’.’ ’\n’ | countsort 3 a 2 b 4 c > echo ’a.a.a.b.b.c.c.c.c’ | tr ’.’ ’\n’ | countsort -n 0 3 a 1 2 b 2 4 c |
There are probably plenty. Please report them to bozomake@disjunkt.com |
Jean-Daniel Pauget (bozomake@disjunkt.com) |
$Id: countsort.1.in 581 2010-04-08 21:42:14Z jd $ |