Skip to content

Instantly share code, notes, and snippets.

@fatso83
Created September 17, 2020 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fatso83/85a4934f6fe25ff34af389c4104ad14c to your computer and use it in GitHub Desktop.
Save fatso83/85a4934f6fe25ff34af389c4104ad14c to your computer and use it in GitHub Desktop.
jq to csv with newlines
# based on https://medium.com/@henatyokotraveler/convert-json-file-with-line-break-to-csv-with-jq-command-577fe88c5bc1
# but cleaned non-copy-paste friendly ligatures and injected spaces
jq '.some.filter | @csv' | sed 's/\\\\/\\/g' | sed 's/\\\"/\"/g' | sed 's/^"//g' | sed 's/"$//g'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment