Created
December 9, 2021 10:37
-
-
Save wader/e601fb51d18a90a66733027c4253cad2 to your computer and use it in GitHub Desktop.
Parse broken JSON with jq
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
| echo '[{"a":123, "b":123, "c": 2},' | jq --stream | jq -s 'reduce (.[] | select(.[1])) as $p ({}; setpath($p[0]; $p[1])?)' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment