Skip to content

Instantly share code, notes, and snippets.

@nalamchaitanya
Last active June 16, 2016 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nalamchaitanya/aaf7a7f034cf8faa900a1483c2117e56 to your computer and use it in GitHub Desktop.
Save nalamchaitanya/aaf7a7f034cf8faa900a1483c2117e56 to your computer and use it in GitHub Desktop.
All hacks related to awk
awk -F ',' '{print $1,$2}' <filename> #Divides the ',' separated file and prints the column 1 and 2 by separting with space.
awk -F ',' '{a[$1]++;}END{print $1,a[$1]}' <filename> # Gives the frequency of words in file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment