Command:
awk ' NF > 0{ counts[$0] = counts[$0] + 1; } END { for (word in counts) print word, counts[word]; }' FILE.DAT
Example:
FILE.DAT
--------
A
B
C
A
B
B
The result:
A 2
B 3
C 1
Thursday, February 14, 2008
How to create a histogram using awk
o 12:20 AM
Subscribe to:
Post Comments (Atom)
1 komentárov:
I really like your blog and i really appreciate the excellent quality content you are posting here for free for your online readers. thanks peace claudia.
Post a Comment