Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 1.13 KB

merge_json_folders.md

File metadata and controls

26 lines (21 loc) · 1.13 KB

JSON to JSON

Merges several folders of JSON files into a single folder of JSON files based on their file name.

Steps

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.

  1. Clone this repository.
  2. Open a PowerShell window to the ~/src directory.
  3. Merge several folders of JSON files into a single folder of JSON files based on their file name.
    • The -in parameter controls the source folders. It is a csv list. NOTE: only JSON 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