Skip to content

Latest commit

 

History

History
57 lines (48 loc) · 1.18 KB

File metadata and controls

57 lines (48 loc) · 1.18 KB

csv2json

Go Report Card Go Doc Release CircleCI

Simple tool for converting CSVs to JSON

Installation

First install Go.

GOBIN=$(pwd) GOPATH=$(mktemp -d) go get github.com/dstull/csv2json
go build

Usage

./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"
    ]
  ]
}