#!/usr/bin/gawk -f #/* vim: set filteype=awk : */ -*- awk -*- BEGIN{ OFS="," FS="," IGNORECASE=1 Brief=0 } { gsub(/^#.*/,"") } { gsub(/[\'\"\`]/, "", $0) } /^[ \t]*$/ { next } Data && NF > 1 { Freq[$NF]++ } /@data/ { Data=1 } END{ for(N in Freq) if (Brief) { print N } else { print Freq[N],N } }