Skip to content

Instantly share code, notes, and snippets.

@ScalaWilliam
Last active May 11, 2017 03:33
Show Gist options
  • Save ScalaWilliam/704b935572ad487a9693d631d64d4afe to your computer and use it in GitHub Desktop.
Save ScalaWilliam/704b935572ad487a9693d631d64d4afe to your computer and use it in GitHub Desktop.
cut -c 1-10,20- | \
cut -f 1,2 -d $'\t' | \
mawk -F $'\t' -v OFS=$'\t' '$1 == last_date { counts[$2]++; } $1 != last_date { for ( i in counts ) print last_date, counts[i], i; last_date = $1; delete counts; }; END {for ( i in counts ) print last_date, counts[i], i;}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment