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

How to get jq to output a long dataset?

$
0
0

Suppose I have this ndjson:

{"id": "one", "colors": [{"color": "blue"}, {"color": "red"}]}{"id": "two", "colors": [{"color": "green"}]}

How do I get the output below?

one blueone redtwo green

Here is a failed attempt:

$ cat tmp/test.json  | jq -r '.id, .colors[].color'oneblueredtwogreen

Here is a second failed attempt:

$ cat tmp/test.json  | jq -r '[.id, .colors[].color]|@tsv'one blue    redtwo green

Viewing all articles
Browse latest Browse all 657

Trending Articles



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