Created
June 6, 2023 11:31
-
-
Save valtoni/4aba7709be240d2853e1db67641bd1ac to your computer and use it in GitHub Desktop.
Group By Count Using awk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name 'message-*.csv' -exec wc -l {} \; | awk -F'[[:space:]-]' ' | |
NR == 1 { print; next } | |
{ | |
id = $3; | |
qty = $1; | |
if (qty < 289) { | |
reads[id] = qty; | |
} | |
} END { | |
for (r in reads) { | |
qty = reads[r]; | |
printf "%-15s\t%s\n", r, qty | "sort -rnk2"; | |
} | |
} | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment