Skip to content

Eetami/csv-to-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

csv-to-json

Simple bash script for converting CSV to JSON.

The script read CSV from stdin and prints JSON to stdout.

Example usage

Read from pipe

$ echo "foo,bar
yolo,swag" | csv-to-json
[{"foo": "yolo","bar": "swag"}]

Read from file

$ csv-to-json <foo-bar.csv
[{"foo": "yolo","bar": "swag"}]

Read from here document

$ csv-to-json <<EOF
foo,bar
yolo,swag
EOF
[{"foo": "yolo","bar": "swag"}]

Read from here document and pipe to jq

$ ./csv-to-json <<EOF | jq
> foo,bar
> yolo,swag
> EOF
[
  {
    "foo": "yolo",
    "bar": "swag"
  }
]

About

Simple bash script for converting CSV to JSON

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages