Simple tool for converting CSVs to JSON
First install Go.
GOBIN=$(pwd) GOPATH=$(mktemp -d) go get github.com/dstull/csv2json
go build
./csv2json -h
Usage of csv2json:
-i string
Input file (default: stdin)
-o string
Output file (default: stdout)
$ more test.csv
first,second,third,fourth
a,b,c,d
e,f,g,h
$ ./csv2json -i=test.csv| jsonpp
{
"columns": [
"first",
"second",
"third",
"fourth"
],
"lines": [
[
"a",
"b",
"c",
"d"
],
[
"e",
"f",
"g",
"h"
]
]
}