|
| 1 | +<!DOCTYPE html> |
| 2 | +<html> |
| 3 | +<head> |
| 4 | + <title>Caltech Library's Digital Library Development Sandbox</title> |
| 5 | + <link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'> |
| 6 | + <link rel="stylesheet" href="/css/site.css"> |
| 7 | +</head> |
| 8 | +<body> |
| 9 | +<header> |
| 10 | +<a href="http://library.caltech.edu"><img src="assets/liblogo.gif" alt="Caltech Library logo"></a> |
| 11 | +</header> |
| 12 | +<nav> |
| 13 | +<ul> |
| 14 | +<li><a href="/">home</a></li> |
| 15 | +<li><a href="./">README</a></li> |
| 16 | +<li><a href="license.html">LICENSE</a></li> |
| 17 | +<li><a href="install.html">INSTALL</a></li> |
| 18 | +<li><a href="csvcols.html">csvcols</a></li> |
| 19 | +<li><a href="csvjoin.html">csvjoin</a></li> |
| 20 | +<li><a href="csv2mdtable.html">csv2mdtable</a></li> |
| 21 | +<li><a href="csv2xlsx.html">csv2xlsx</a></li> |
| 22 | +<li><a href="csv2json.html">csv2json</a></li> |
| 23 | +<li><a href="jsoncols.html">jsoncols</a></li> |
| 24 | +<li><a href="jsonrange.html">jsonrange</a></li> |
| 25 | +<li><a href="xlsx2json.html">xlsx2json</a></li> |
| 26 | +<li><a href="xlsx2csv.html">xlsx2csv</a></li> |
| 27 | +<li><a href="https://github.com/caltechlibrary/datatools">Github</a></li> |
| 28 | +</ul> |
| 29 | + |
| 30 | +</nav> |
| 31 | + |
| 32 | +<section> |
| 33 | +<h1>USAGE</h1> |
| 34 | + |
| 35 | +<pre><code>csv2json [OPTIONS] |
| 36 | +</code></pre> |
| 37 | + |
| 38 | +<h2>SYNOPSIS</h2> |
| 39 | + |
| 40 | +<p>csv2json reads CSV from stdin and writes a JSON to stdout. JSON output |
| 41 | +can be either an array of JSON blobs or one JSON blob (row as object) |
| 42 | +per line.</p> |
| 43 | + |
| 44 | +<h2>OPTIONS</h2> |
| 45 | + |
| 46 | +<pre><code> -as-blobs output as one JSON blob per line |
| 47 | + -h display help |
| 48 | + -help display help |
| 49 | + -i input filename |
| 50 | + -input input filename |
| 51 | + -l display license |
| 52 | + -license display license |
| 53 | + -o output filename |
| 54 | + -output output filename |
| 55 | + -use-header treat the first row as field names |
| 56 | + -v display version |
| 57 | + -version display version |
| 58 | +</code></pre> |
| 59 | + |
| 60 | +<h2>EXAMPLES</h2> |
| 61 | + |
| 62 | +<p>Convert data1.csv to data1.json using Unix pipes.</p> |
| 63 | + |
| 64 | +<pre><code class="language-shell"> cat data1.csv | csv2json > data1.json |
| 65 | +</code></pre> |
| 66 | + |
| 67 | +<p>Convert data1.csv to JSON blobs, one line per blob</p> |
| 68 | + |
| 69 | +<pre><code class="language-shell"> csv2json -as-blobs -i data1.csv |
| 70 | +</code></pre> |
| 71 | + |
| 72 | +</section> |
| 73 | + |
| 74 | +<footer> |
| 75 | +<span><h1><A href="http://caltech.edu">Caltech</a></h1></span> |
| 76 | +<span>© 2017 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span> |
| 77 | +<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address> |
| 78 | +<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span> |
| 79 | +<span><a href=" mailto:[email protected]" >Email Us </a></span> |
| 80 | +<a class="cl-hide" href="sitemap.xml">Site Map</a> |
| 81 | +</footer> |
| 82 | +</body> |
| 83 | +</html> |
0 commit comments