Skip to content

Instantly share code, notes, and snippets.

@TrevorBasinger
Created February 15, 2016 16:17
Show Gist options
  • Save TrevorBasinger/25b54af5e73651264fb0 to your computer and use it in GitHub Desktop.
Save TrevorBasinger/25b54af5e73651264fb0 to your computer and use it in GitHub Desktop.
#!/bin/bash
cat - | jq -r '(map (keys) | add | unique) as $cols | map (. as $row | $cols | map ($row[.])) as $rows | $cols, $rows[] | @csv'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment