Converter using headers to minimize file size
Add this to your application's shard.yml
:
dependencies:
csv2json_cr:
github: dstull/csv2json_cr
require "csv2json_cr"
./csv2json -h
csv2json - converts csv to a particular format in json.
Usage:
csv2json [flags] [arguments]
Commands:
help [command] # Help about any command.
Flags:
-h, --help # Help for this command. default: 'false'.
-i, --input # The csv file to convert. default: 'test.csv'.
-o, --output # The json file to be created. default: 'test.json'.
$ cat test.csv
first,second,third,fourth
a,b,c,d
e,f,g,h
$ /csv2json --input test.csv --output test.json
$ cat test.json
{
"columns": [
"first",
"second",
"third",
"fourth"
],
"lines": [
[
"a",
"b",
"c",
"d"
],
[
"e",
"f",
"g",
"h"
]
]
}
TODO: Write development instructions here
- Fork it (https://github.com/dstull/csv2json_cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
- dstull Doug Stull - creator, maintainer