|
| 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>csvcleaner [OPTIONS]</h2> |
| 26 | + |
| 27 | +<p>csvcleaner normalizes a CSV file based on the options selected. It |
| 28 | +helps to address issues like variable number of columns, leading/trailing |
| 29 | +spaces in columns, and non-UTF-8 encoding issues.</p> |
| 30 | + |
| 31 | +<p>By default input is expected from standard in and output is sent to |
| 32 | +standard out (errors to standard error). These can be modified by |
| 33 | +appropriate options. The csv file is processed as a stream of rows so |
| 34 | +minimal memory is used to operate on the file.</p> |
| 35 | + |
| 36 | +<h2>OPTIONS</h2> |
| 37 | + |
| 38 | +<pre><code> -comma if set use this character in place of a comma for delimiting cells |
| 39 | + -comment-char if set, rows starting with this character will be ignored as comments |
| 40 | + -example display example(s) |
| 41 | + -fields-per-row set the number of columns to output right padding empty cells as needed |
| 42 | + -h display help |
| 43 | + -help display help |
| 44 | + -i input filename |
| 45 | + -input input filename |
| 46 | + -l display license |
| 47 | + -left-trim-spaces If set to true leading white space in a field is ignored. |
| 48 | + -license display license |
| 49 | + -o output filename |
| 50 | + -output output filename |
| 51 | + -output-comma if set use this character in place of a comma for delimiting output cells |
| 52 | + -reuse if false then a new array is allocated for each row processed, if true the array gets reused |
| 53 | + -right-trim-spaces If set to true trailing white space in a field is ignored. |
| 54 | + -stop-on-error exit on error, useful if you're trying to debug a problematic CSV file |
| 55 | + -trim-spaces If set to true leading and trailing white space in a field is ignored. |
| 56 | + -use-crlf if set use a charage return and line feed in output |
| 57 | + -use-lazy-quoting If LazyQuotes is true, a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field. |
| 58 | + -v display version |
| 59 | + -verbose write verbose output to standard error |
| 60 | + -version display version |
| 61 | +</code></pre> |
| 62 | + |
| 63 | +<h2>EXAMPLES</h2> |
| 64 | + |
| 65 | +<p>Normalizing a spread sheet’s column count to 5 padding columns as needed per row.</p> |
| 66 | + |
| 67 | +<pre><code class="language-shell"> cat mysheet.csv | csvcleaner -field-per-row=5 |
| 68 | +</code></pre> |
| 69 | + |
| 70 | +<p>Trim leading spaces.</p> |
| 71 | + |
| 72 | +<pre><code class="language-shell"> cat mysheet.csv | csvcleaner -left-trim-spaces |
| 73 | +</code></pre> |
| 74 | + |
| 75 | +<p>Trim trailing spaces.</p> |
| 76 | + |
| 77 | +<pre><code class="language-shell"> cat mysheet.csv | csvcleaner -right-trim-spaces |
| 78 | +</code></pre> |
| 79 | + |
| 80 | +<p>Trim leading and trailing spaces</p> |
| 81 | + |
| 82 | +<pre><code class="language-shell"> cat mysheet.csv | csvcleaner -trim-spaces |
| 83 | +</code></pre> |
| 84 | + |
| 85 | +<p>csvcleaner v0.0.17</p> |
| 86 | + |
| 87 | +</section> |
| 88 | + |
| 89 | +<footer> |
| 90 | +<span><h1><A href="http://caltech.edu">Caltech</a></h1></span> |
| 91 | +<span>© 2017 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span> |
| 92 | +<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address> |
| 93 | +<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span> |
| 94 | +<span><a href=" mailto:[email protected]" >Email Us </a></span> |
| 95 | +<a class="cl-hide" href="sitemap.xml">Site Map</a> |
| 96 | +</footer> |
| 97 | +</body> |
| 98 | +</html> |
0 commit comments