Skip to content

Instantly share code, notes, and snippets.

@ashtonmeuser
Created April 30, 2025 20:00
Show Gist options
  • Save ashtonmeuser/cdf71fa0e5f7f201c33a5933c344b661 to your computer and use it in GitHub Desktop.
Save ashtonmeuser/cdf71fa0e5f7f201c33a5933c344b661 to your computer and use it in GitHub Desktop.
Convert a JSON array of objects to CSV
jq -r '(.[0] | keys_unsorted) as $keys | $keys, map([.[ $keys[] ]])[] | @csv' input.json > output.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment