Skip to content

Gisleburt/csv2json

Repository files navigation

GitHub release GitHub license Crates.io

csv2json

Turns a CSV into a JSON file

Installation:

$ cargo install csv2json

Usage:

$ csv2json --in <csv file> > <json file>

If your CSV contains multidimensional data, you can add use the dimensional separator argument -d

Eg:

name.first,name.last,age
Daniel,Mason,not telling

Without using the separator:

[
  {
    "age": "not telling",
    "name.first": "Daniel",
    "name.last": "Mason"
  }
]

Setting the separator -d .:

[
  {
    "name": {
      "first": "Daniel",
      "last": "Mason"
    },
    "age": "not telling"
  }
]

About

Turns CSVs into JSON documents

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages