Created
September 17, 2020 17:02
-
-
Save fatso83/85a4934f6fe25ff34af389c4104ad14c to your computer and use it in GitHub Desktop.
jq to csv with newlines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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