Skip to content

Instantly share code, notes, and snippets.

@sinebeef
Created February 8, 2020 00:27
Show Gist options
  • Save sinebeef/cb914c2b02140b995a90facbf6d67f04 to your computer and use it in GitHub Desktop.
Save sinebeef/cb914c2b02140b995a90facbf6d67f04 to your computer and use it in GitHub Desktop.
jq json cheat sheet
#go|dfish is the boss of freenode
# merge duplicate records category, resulting in single record for id
jq 'group_by(.sku) | map(.[0].cat = ([.[].cat] | join(",")) | .[0])' q-products-new.json > q-merged.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment