countsort-1.2.0

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
FILES
EXAMPLE
SEE ALSO
BUGS
AUTHOR
MANPAGE VERSION

NAME

countsort − counts all subsequent identical lines from stdin

SYNOPSIS

countsort [ -n ]

DESCRIPTION

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.

OPTIONS

-n

prepends each output line with it’s own occurence order (1 for the first, 2 for the second ...)

FILES

none.

EXAMPLE

> 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

SEE ALSO

(1)percent, (1)count, (1)revtail, (1)brev, (1)scramble.

BUGS

There are probably plenty. Please report them to bozomake@disjunkt.com

AUTHOR

Jean-Daniel Pauget (bozomake@disjunkt.com)

MANPAGE VERSION

$Id: countsort.1.in 581 2010-04-08 21:42:14Z jd $