Skip to content

Instantly share code, notes, and snippets.

@digitalex
Created October 23, 2012 13:04
Show Gist options
  • Save digitalex/3938619 to your computer and use it in GitHub Desktop.
Save digitalex/3938619 to your computer and use it in GitHub Desktop.
GROUP BY in awk
awk -F'\t' '{ if(a[$1]) a[$1]=a[$1]","$2; else a[$1]=$2;} END {for (i in a) print i, a[i];}' OFS='\t' clickthroughs.tsv | sort > clickthroughs2.tsv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment