Skip to content

Instantly share code, notes, and snippets.

@bawbgale
Last active August 29, 2015 14:22
Show Gist options
  • Save bawbgale/2bb60bec9154e6b49d8e to your computer and use it in GitHub Desktop.
Save bawbgale/2bb60bec9154e6b49d8e to your computer and use it in GitHub Desktop.
Convert a set of flat JSON objects with consistent key order to CSV
cat part-00000 | jq -s -r '.[0] | to_entries | map(.key) | @csv' > all.csv | cat part-* | jq -s -r '.[] | to_entries | map(.value) | @csv' >> all.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment