Last active
July 22, 2023 16:44
-
-
Save h4k1m0u/1f67a75d591fa575c52e6aca04dd4551 to your computer and use it in GitHub Desktop.
Count occurrences of each number in a json file
This file contains hidden or 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
cat file.json | sed -e 's/[^0-9]//g' -e '/^$/d' | sort | uniq -c |
This file contains hidden or 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
{ | |
"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