Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A tool for converting CSV input to JSON output.

NotificationsYou must be signed in to change notification settings

senseyeio/csvtojson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Reads a CSV file and emits one JSON object for each row of the input CSV.

Flags

  • -n Do not use the first row of the file as headings. Treat the first row as data.
  • -t <col1,...> Use the comma-separated list of values,<col1,...>, as column headings. Use of this flag implies-n.

Aside from flags, all command line arguments are treated as filenames to read. If no files are specified, inputis read from STDIN.

All rows in an individual file must contain the same number of columns.

Example Usage

Reading from STDIN, using the first row as column headings:

$ echo -e "asset,online,mode\nrobot1,true,test\nrobot2,false,sleep" | csvtojson{"asset":"robot1","mode":"test","online":"true"}{"asset":"robot2","mode":"sleep","online":"false"}

Reading from STDIN, using the first row as data:

$ echo -e "robot1,true,test\nrobot2,false,sleep" | csvtojson -n{"_column0":"robot1","_column1":"true","_column2":"test"}{"_column0":"robot2","_column1":"false","_column2":"sleep"}

About

A tool for converting CSV input to JSON output.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp