skip to Main Content

Json – JQ – Groupby and concatenate text objects

Not quite getting it. I can produce multiple lines but cannot get multiple entries to combine. Looking to take Source JSON and output to CSV as shown: Source JSON: [{"State": "NewYork","Drivers": [ {"Car": "Jetta","Users": [{"Name": "Steve","Details": {"Location": "Home","Time": "9a-7p"}}]}, {"Car":…

VIEW QUESTION

How to parse nested json to csv using command line

I want to parse a nested json to csv. The data looks similar to this. {"tables":[{"name":"PrimaryResult","columns":[{"name":"name","type":"string"},{"name":"id","type":"string"},{"name":"custom","type":"dynamic"}]"rows":[["Alpha","1","{"age":"23","number":"xyz"}]]]} I want csv file as: name id age number alpha 1 23 xyz I tried: jq -r ".tables | .[] | .columns | map(.name)|@csv"…

VIEW QUESTION
Back To Top
Search