K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / share / doc / gawk / examples / prog /
server ip : 104.21.89.46

your ip : 172.70.179.71

H O M E


Filename/usr/share/doc/gawk/examples/prog/wordfreq.awk
Size347
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:55
Last modified29-Mar-2012 04:03
Last accessed08-Jul-2025 06:15
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
# wordfreq.awk --- print list of word frequencies

{
$0 = tolower($0) # remove case distinctions
# remove punctuation
gsub(/[^[:alnum:]_[:blank:]]/, "", $0)
for (i = 1; i <= NF; i++)
freq[$i]++
}

END {
sort = "sort -k 2nr"
for (word in freq)
printf "%s\t%d\n", word, freq[word] | sort
close(sort)
}