A simple command line for convert CSV in JSON list of objects based on header.
With Go 1.17 or higher:
go install github.com/edermanoel94/c2j
To convert, run the
c2j command to read from STDIN, using standard delimiter, which is comma.
$ cat example_comma.csv | c2j
Convert with custom delimiter
--delimiter or short version
-d flag to specify a delimiter.
$ cat example_semicolon.csv | c2j --delimiter ";"
- Convert without header and generate keys based on index (WIP)
- Use a path to file argument for convert
- Save output to a file
Pull requests for new features, bug fixes, and suggestions are welcome!
I use Twitch to stream, follow me, to see new features on this project.