Categories
Development

Merge files in Windows cmd & Power Shell

Windows cmd

cmd /c 'copy /y /b *.json output.json' 

Windows Power Shell

2 options are here:

Get-Content *.json | Set-Content result.json
Copy-Item *.json output.json

How to wrap joined lines into valid JSON

After merging json files we append commas to the end of each line and bracket around the whole content with [ ] using eg. Notepadd++ for that. Thus we get a valid JSON:

[
{ "Full Year Tax":"145,26$"… },
{ "Full Year Tax":"139,00$"… },
{ "Full Year Tax":"100,00$"… }
]

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.