https://github.com/winebarrel/xjsonl
xjsonl is a tool to convert xSV to JSON Lines.
https://github.com/winebarrel/xjsonl
csv golang json tsv
Last synced: about 1 year ago
JSON representation
xjsonl is a tool to convert xSV to JSON Lines.
- Host: GitHub
- URL: https://github.com/winebarrel/xjsonl
- Owner: winebarrel
- Created: 2020-06-19T12:47:31.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-29T16:43:38.000Z (almost 6 years ago)
- Last Synced: 2024-10-19T00:14:47.586Z (over 1 year ago)
- Topics: csv, golang, json, tsv
- Language: Go
- Homepage:
- Size: 22.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# xjsonl
xjsonl is a tool to convert xSV to JSON Lines.
[](https://travis-ci.org/winebarrel/xjsonl)
## Usage
```
Usage of xjsonl:
-header
consider the first line as a header
-keys string
json object keys
-sep string
line separator. not split if empty (default ",")
-version
print version and exit
```
```
$ printf 'foo,bar\nbar,zoo' | xjsonl
["foo","bar"]
["bar","zoo"]
$ printf 'foo\tbar\nbar\tzoo' | xjsonl -sep '\t'
["foo","bar"]
["bar","zoo"]
$ printf 'foo,bar\nbar,zoo' | xjsonl -sep ''
["foo,bar"]
["bar,zoo"]
$ printf 'foo,bar\nbar,zoo' > data.csv
$ xjsonl data.csv
["foo","bar"]
["bar","zoo"]
$ printf 'foo,bar\nbar,zoo' | xjsonl -keys a,b
{"a":"foo","b":"bar"}
{"a":"bar","b":"zoo"}
$ printf "foo,bar\nzoo,baz\n1,2" | xjsonl -header
{"foo":"zoo","bar":"baz"}
{"foo":"1","bar":"2"}
```
## Related Links
* https://github.com/winebarrel/xjr