Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.45 KB

README.md

File metadata and controls

49 lines (33 loc) · 1.45 KB

Combine JSON Arrays (of Objects)

Combine JSON Arrays is a D program for combining multiple JSON array files (containing Objects) into a single output file.

Installation

You need to have a D Language compiler installed in your system.

Usage

Compile using a D lang compiler and run it using -i <input folder>. The input folder should contains JSON file.

An example to compile using the dmd compiler and run it.

$ dmd combine-json-arrays.d
$ ./combine-json-arrays.exe -i <input-folder>

Alternatively, if you have the dmd compiler installed, you can run this like a script using rdmd tool.

$ rdmd combine-json-arrays.d -i <input-folder>

Note

  • Input files that are not JSON arrays will be skipped.
  • Input files containing any of the following strings will be excluded:
    • output,
    • combined
  • Output files will be timestamped.

Output

An output file will be generated in the input folder with a timestamp.

Example

$ rdmd combine-json-arrays.d -i input/
Combine JSON arrays (of objects): ignoring input/2022-08-15T1131-output-combined.json
Combine JSON arrays (of objects): input/sample-data-1.json, length: 58
Combine JSON arrays (of objects): input/sample-data-2.json, length: 16
Combine JSON arrays (of objects): ignoring input/sample-data-3.json, not a JSON array of Objects.

License

MIT