Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 531

JQ question about parsing dictionaries within lists

$
0
0

I have a json file in the following format

{"a": [    [      {"p": "p1-value","d": "d1-value"      },      {"p": "p2-value","d": "d2-value"      }    ],    [      {"p": "p3-value","d": "d3-value"      }    ]  ],"z": [    [      {"p": "p1-value","d": "d1-value"      }    ]  ]}

and I'd like to know how to output something like this

a p1-valuea p2-valuea p3-valuex p1-value

I've tried a few different jq queries but I can't get it to work.

I know I can use 'keys[]' at the top level but that doesn't give me anything below it. I've tried ."a" | .[] | .[] | .path but that means I have to specify each top level key..

Thanks


Viewing all articles
Browse latest Browse all 531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>