Skip to content

Instantly share code, notes, and snippets.

@Kyu
Created November 18, 2020 12:20
Show Gist options
  • Save Kyu/eae1553d742b866cc11007f72a3ec3c7 to your computer and use it in GitHub Desktop.
Save Kyu/eae1553d742b866cc11007f72a3ec3c7 to your computer and use it in GitHub Desktop.
Gets most talkative users from whatsapp archive
#!/usr/bin/bash
cat _chat.txt | sed "s|[[0-9 / , :]*][[:space:]]||" | grep -o ".*:" | sed 's/:.*//g' | tr -cd '[:print:]\r\n\t' | grep -v "^\s*$" | sort | uniq -c | sort -bnr
# cat file | replace [date/date/date , , , ] with "" | get everything before ":" | GET EVERYTHING BEFORE FIRST ":" | filter out non printing chars | idk tbh something to do with the count | idk I should man this | sorting ?? idk i shsould man this
# prints out most talkative in chat, w some false pos
# https://unix.stackexchange.com/a/39044/427069 -- sort - Get text-file word occurrence count of all words & print output sorted
# https://stackoverflow.com/a/3540639/3875151 -- bash - Removing non-displaying characters from a file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment