Skip to content

Instantly share code, notes, and snippets.

@h4k1m0u
Last active July 22, 2023 16:44
Show Gist options
  • Save h4k1m0u/1f67a75d591fa575c52e6aca04dd4551 to your computer and use it in GitHub Desktop.
Save h4k1m0u/1f67a75d591fa575c52e6aca04dd4551 to your computer and use it in GitHub Desktop.
Count occurrences of each number in a json file
cat file.json | sed -e 's/[^0-9]//g' -e '/^$/d' | sort | uniq -c
{
"111": [
222,
333
],
"222": [
222,
333
],
"333": [
111,
222
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment