Skip to content

Instantly share code, notes, and snippets.

@moniyax
Last active August 29, 2015 14:00
Show Gist options
  • Save moniyax/11257562 to your computer and use it in GitHub Desktop.
Save moniyax/11257562 to your computer and use it in GitHub Desktop.
Computing frequencies of categories in tab-delimited dataset
awk -F '\t' -v rec=5 '{a[$rec]+=1; sum+=1} END{for(k in a) print k, ":", a[k] "(freq),", a[k]/sum "(prop)"; print "sum:", sum}' file.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment