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

How to merge 2 json files using jq (deep merge and concat array)

$
0
0

With jq command, I want to merge multiple json files.

But I have no idea how to achieve below expectation.

a.json

{"key1": {"key2": [            1,            2        ]    },"key3": "aaa"}

b.json

{"key1": {"key2": [            3,            4,            5        ]    },"key4": "bbb"

expected result

{"key1": {"key2": [            1,            2,            3,            4,            5        ]    },"key3": "aaa","key4": "bbb"}

Viewing all articles
Browse latest Browse all 527

Trending Articles



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