Skip to content

Instantly share code, notes, and snippets.

@rapee
Created August 29, 2019 06:50
Show Gist options
  • Save rapee/4d93cd952f8e8217140334c02c4c8ad6 to your computer and use it in GitHub Desktop.
Save rapee/4d93cd952f8e8217140334c02c4c8ad6 to your computer and use it in GitHub Desktop.
JSON to CSV
# Use pure jq
# Assumes input JSON is array of objects:
# [ { a: 1, b: 1, ...} , { a: 2, b:2, ... }, ... ]
jq -r '.[] | to_entries | [.[].value] | @csv' 20190829_ippd_survey1_results.json > 20190829_ippd_survey1_results.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment