Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/baltimore-sun-data/csv2json
Simple tool for converting CSVs to JSON
https://github.com/baltimore-sun-data/csv2json
command-line-tool csv go golang json
Last synced: 8 days ago
JSON representation
Simple tool for converting CSVs to JSON
- Host: GitHub
- URL: https://github.com/baltimore-sun-data/csv2json
- Owner: baltimore-sun-data
- License: mit
- Created: 2018-02-06T15:38:26.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-05T19:51:44.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T06:29:54.716Z (5 months ago)
- Topics: command-line-tool, csv, go, golang, json
- Language: Go
- Size: 4.88 KB
- Stars: 6
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# csv2json
Simple tool for converting CSVs to JSON
## Installation
First install [Go](http://golang.org).
If you just want to install the binary to your current directory and don't care about the source code, run
```shell
GOBIN=$(pwd) GOPATH=$(mktemp -d) go get github.com/baltimore-sun-data/csv2json
```## Usage
```shell
$ 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"
]
]
```