I was just introduced to JQ in a question I posted about an hour ago, I'm parsing a very large database however, with JQ the output looks like this:
"removedforprivacy@gmail.com"
"john"
"smith"
null
null
"123 road st"
null
"Columbia"
"29203"
"SC"
null
instead I want it to look like this:
"removedforprivacy@gmail.com" "john" "smith" null null "123 road st" null "Columbia" "29203" "SC" null
or even better:
"removedforprivacy@gmail.com","john","smith",null,null,"123,road,st",null,"Columbia","29203","SC",null
I'm currently using this command:
jq -c '(.email, .first_name, .last_name, .ip, .address, .address1, .address2, .city, .zip, .state, .phone)' file.json > file2.json
I've tried using this command as well:
jq -compact-output '(.email, .first_name, .last_name, .ip, .address, .address1, .address2, .city, .zip, .state, .phone)' file.json > file2.json
but file2.json still shows data like this:
"removedforprivacy@gmail.com"
"john"
"smith"
null
null
"123 road st"
null
"Columbia"
"29203"
"SC"
null
In short, I'd like to turn the output into something that looks like a csv or is a csv so I can manage it better.
The command isn't working and just need this command for a one time use.