File Merger Ordered on Mac Terminal

I have json files named like this: 1.json , 2.json … 604.json

Then, I want to merged those files into one file.

So, the solution is just run this command on terminal:

for f in {1..604}.json; do (cat "${f}"; echo) >> mergedfile.json; done

Just try it!

References:

https://stackoverflow.com/questions/8183191/concatenating-files-and-insert-new-line-in-between-files

--

--