Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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