|
| 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="../">up</a></li> |
| 16 | +<li><a href="./">Documentation</a></li> |
| 17 | +<li><a href="../how-to/">How To …</a></li> |
| 18 | +</ul> |
| 19 | + |
| 20 | +</nav> |
| 21 | + |
| 22 | +<section> |
| 23 | +<h1>USAGE</h1> |
| 24 | + |
| 25 | +<h2>csvrows [OPTIONS] [ARGS_AS_ROW_VALUES]</h2> |
| 26 | + |
| 27 | +<h2>SYNOPSIS</h2> |
| 28 | + |
| 29 | +<p>csvrows converts a set of command line args into rows of CSV formated output. |
| 30 | +It can also be used to filter or list specific rows of CSV input |
| 31 | +The first row is 1 not 0. Often row 1 is the header row and %!s(MISSING) makes it |
| 32 | +easy to output only the data rows.</p> |
| 33 | + |
| 34 | +<h2>OPTIONS</h2> |
| 35 | + |
| 36 | +<pre><code>-d set delimiter character |
| 37 | +-delimiter set delimiter character |
| 38 | +-h display help |
| 39 | +-header display the header row (alias for '-rows 1') |
| 40 | +-help display help |
| 41 | +-i input filename |
| 42 | +-input input filename |
| 43 | +-l display license |
| 44 | +-license display license |
| 45 | +-o output filename |
| 46 | +-output output filename |
| 47 | +-row output specified rows in order (e.g. -row 1,5,2:4)) |
| 48 | +-rows output specified rows in order (e.g. -rows 1,5,2:4)) |
| 49 | +-skip-header-row skip the header row (alias for -row 2: |
| 50 | +-v display version |
| 51 | +-version display version |
| 52 | +</code></pre> |
| 53 | + |
| 54 | +<h2>EXAMPLES</h2> |
| 55 | + |
| 56 | +<p>Simple usage of building a CSV file one rows at a time.</p> |
| 57 | + |
| 58 | +<pre><code class="language-shell"> csvrows "First,Second,Third" "one,two,three" > 4rows.csv |
| 59 | + csvrows "ein,zwei,drei" "1,2,3" >> 4rows.csv |
| 60 | + cat 4row.csv |
| 61 | +</code></pre> |
| 62 | + |
| 63 | +<p>Example parsing a pipe delimited string into a CSV line</p> |
| 64 | + |
| 65 | +<pre><code class="language-shell"> csvrows -d "|" "First,Second,Third|one,two,three" > 4rows.csv |
| 66 | + csvrows -delimiter "|" "ein,zwei,drei|1,2,3" >> 4rows.csv |
| 67 | + cat 4rows.csv |
| 68 | +</code></pre> |
| 69 | + |
| 70 | +<p>Filter a 10 row CSV file for rows 1,4,6 (top most row is one)</p> |
| 71 | + |
| 72 | +<pre><code class="language-shell"> cat 10row.csv | csvrows -row 1,4,6 > 3rows.csv |
| 73 | +</code></pre> |
| 74 | + |
| 75 | +<p>Filter a 10 row CSV file for rows 1,4,6 from file named “10row.csv”</p> |
| 76 | + |
| 77 | +<pre><code class="language-shell"> csvrows -i 10row.csv -row 1,4,6 > 3rows.csv |
| 78 | +</code></pre> |
| 79 | + |
| 80 | +<p>csvrows v0.0.14</p> |
| 81 | + |
| 82 | +</section> |
| 83 | + |
| 84 | +<footer> |
| 85 | +<span><h1><A href="http://caltech.edu">Caltech</a></h1></span> |
| 86 | +<span>© 2017 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span> |
| 87 | +<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address> |
| 88 | +<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span> |
| 89 | +<span><a href=" mailto:[email protected]" >Email Us </a></span> |
| 90 | +<a class="cl-hide" href="sitemap.xml">Site Map</a> |
| 91 | +</footer> |
| 92 | +</body> |
| 93 | +</html> |
0 commit comments