Skip to content

stand-alone gawk script for "down and dirty" histograms

Notifications You must be signed in to change notification settings

Nebuchadrezzar/freq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

freq

A tiny stand alone (g)awk script to count word frequncies. It lowercases input, removes punctuation, and tallies the count of each value. (An easy to use stand-alone awk script, instead of having to load a function library from gawk itself.)

To install:

$chmod +x freq
$cp freq /usr/local/bin (or somewhere in the your PATH)

To use, a few examples:

Count the frequency of values in a (sql) script:

$< ./createdb.ddl | freq | sort -rn -k2 | head -n 3
commit 2884
date 2096
tablespace 2094

Count the frequency of all the words in the complete works of William Shakespeare:

$curl -s "http://www.gutenberg.org/files/100/100-0.txt" | freq | sort -rn -k2 | head
the 30002
and 28358
i 21867
to 20816
of 18815
a 15992
you 14437
my 13191
in 12032
that 11781

About

stand-alone gawk script for "down and dirty" histograms

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages