Merges several folders of JSON
files into a single folder of JSON
files based on their file name.
Below are the steps needed to run the merge process. The pathing can be changed by updating the parameters.
Elements are merged in folder order with later folders taking presedence.
I.E. element id
in file 1 folder 1 will be overwritten by the id
element in file 1 folder2.
Files that only exist in some, but not all, of the folders will still be merged.
- Clone this repository.
- Open a PowerShell window to the
~/src
directory. - Merge several folders of
JSON
files into a single folder ofJSON
files based on their file name.- The
-in
parameter controls the source folders. It is a csv list. NOTE: onlyJSON
files that do not start with_
will be merged. - The
-out
parameter controls the destination folder. If the folder does not exist it is created. - The optional
-spc
parameter allows for tuning on multi core machines. It defaults to 1.
python merge_json_folders.py -in d:/foo,d:/bar -out d:/baz
- The