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

How to merge arrays within JSON object

$
0
0

Given a JSON object

{"foo":["barfoo"],"bar":["foobar"]}

I would like to merge both arrays, i.e. output:

barfoofoobar

Obviously I can list either array using, e.g. jq -r .foo[] but I'm not sure how to go about merging both.

The array names (foo / bar) are constants, they do not change.


Viewing all articles
Browse latest Browse all 522

Trending Articles



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