json-split-aom

Crates.iojson-split-aom
lib.rsjson-split-aom
version
sourcesrc
created_at2023-09-15 18:10:25.586565
updated_at2024-12-04 14:09:44.938862
descriptionSplit a large JSON file containing an array of maps into multiple files
homepage
repositoryhttps://github.com/qtfkwk/json-split-aom
max_upload_size
id973855
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
(qtfkwk)

documentation

README

Usage

$ json-split-aom -h
Split a large JSON file containing an array of maps into multiple files

Usage: json-split-aom [OPTIONS] -a <JSON_PATH> -i <JSON_PATH> [FILES]...

Arguments:
  [FILES]...  Input file(s)

Options:
  -a <JSON_PATH>      Dotted JSON path to an array in the input file
  -i <JSON_PATH>      Dotted JSON path to the ID in the array element
  -p                  Pretty print output files
  -c                  Allow ID path collisions; still gives warnings but
                      duplicates will overwrite previous files
  -h, --help          Print help
  -V, --version       Print version

---

# Assumptions

* The JSON dotted path keys for array and ID don't have periods.

# Examples
    
1. Use `json-split-aom -a 'Apple.Banana' -i 'id' file.json` to extract objects
   to files named `Apple.Banana-id-ID.json` given a `file.json` with content:
   `{"Apple":{"Banana":[{"id":12,...},...]}}`

2. Use `json-split-aom -a 'Apple' -i 'Banana.id' file.json` to extract objects
   to files named `Apple-Banana.id-ID.json` given a `file.json` with content:
   `{"Apple":[{"Banana":{"id":12,...}},...]}`

3. Use `json-split-aom -a 'Apple.Banana' -i 'Cherry.id' file.json` to extract
   objects to files named `Apple.Banana-Cherry.id-ID.json` given a `file.json`
   with content: `{"Apple":{"Banana":[{"Cherry":{"id":12,...},...}]}}`
$ json-split-aom -V
json-split-aom 0.2.1
Commit count: 5

cargo fmt