percent − summarizes the most important occurences of a countsort output with percentages |
percent [ -r ] |
percent reads each lines from stdin, which should supposely be formated like the output of (1)countsort. percent summerizes all occurences and outputs a repartition of those whith percentages against the whole sum for each entry. The first line of the output diplays the total number of occurences and the total number of entries in parenthesis. The output might be sorted by decreasing occurences or the with initial order of input. percent is almost never used with something else than countsort. |
-r |
Do not sort by decreasing occurences, keep the initial input order. |
none. |
> echo ’a.a.a.b.b.c.c.c.c’ | tr ’.’ ’\n’ | countsort | percent 100 % 9 TOTAL (3 items) 1 44 % 4 c 2 33 % 3 a 3 22 % 2 b > echo ’a.a.a.b.b.c.c.c.c’ | tr ’.’ ’\n’ | countsort | percent -r 100 % 9 TOTAL (3 items) 1 33 % 3 a 2 22 % 2 b 3 44 % 4 c |
There are probably plenty. Please report them to bozomake@disjunkt.com |
Jean-Daniel Pauget (bozomake@disjunkt.com) |
$Id: percent.1.in 581 2010-04-08 21:42:14Z jd $ |