I have bunch of files sitting in folders like
data\A\A\A\json1.json
data\A\A\A\json2.json
data\A\A\B\json1.json
...
data\Z\Z\Z\json_x.json
I want to cat all the jsons into one single file?
I have bunch of files sitting in folders like
data\A\A\A\json1.json
data\A\A\A\json2.json
data\A\A\B\json1.json
...
data\Z\Z\Z\json_x.json
I want to cat all the jsons into one single file?
a short explanation:
I would like this ,easy and simple.
../ avoid the error "input file is output file"
Use
find
to get all the JSON files and concatenate them.Note that this will not be valid JSON. If you want a JSON file to contain multiple objects, they need to be in a containing array or object, so you'd need to add
[ ]
around them and put,
between each one.Alternatively -- if you have a list of your files -- you can pipe that to
xargs