csv2json

command module
v0.0.0-...-cf7530b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2018 License: MIT Imports: 8 Imported by: 0

README

csv2json

Simple tool for converting CSVs to JSON

Installation

First install Go.

If you just want to install the binary to your current directory and don't care about the source code, run

GOBIN=$(pwd) GOPATH=$(mktemp -d) go get github.com/baltimore-sun-data/csv2json

Usage

$ csv2json
Usage of csv2json:
  -dest string
        Destination file (default: stdout)
  -no-headers
        Return each row as an array
  -src string
        Source file (default: stdin)

$ more test.csv
a,b,c
1,2,3

$ csv2json | json-tidy
[
        {
                "a": "1",
                "b": "2",
                "c": "3"
        }
]

$ csv2json -src test.csv -no-headers | json-tidy
[
        [
                "a",
                "b",
                "c"
        ],
        [
                "1",
                "2",
                "3"
        ]
]

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL