Skip to content

The command line program helps converting CSV data to JSON

Notifications You must be signed in to change notification settings

vinh0604/csv2json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csv2json

The command line program helps converting CSV data to JSON

Usage

csv2json -input sample.csv > out.json
cat sample.csv | csv2json > out.json

By default, the program uses the first line in the CSV input as header, in which each column is mapped to the corresponding JSON key, and value is always treated as string.

-header option allows users to specify the arbitrary header as well as the data type and default value

Format :

-header <keyName>:<dataType>:<defaultValue>,<keyName>:<dataType>:<defaultValue>

Supported data types are:

string
number
boolean

Example:

csv2json -input sample.csv -header name:string:,age:number:0

About

The command line program helps converting CSV data to JSON

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages