Skip to content

Commit 7ba7740

Browse files
committed
prep for release v0.0.17
1 parent 74a76bf commit 7ba7740

File tree

2 files changed

+168
-0
lines changed

2 files changed

+168
-0
lines changed

docs/csvcleaner.html

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
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 &hellip;</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&rsquo;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>&copy; 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>

docs/csvcleaner.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
2+
# USAGE
3+
4+
## csvcleaner [OPTIONS]
5+
6+
csvcleaner normalizes a CSV file based on the options selected. It
7+
helps to address issues like variable number of columns, leading/trailing
8+
spaces in columns, and non-UTF-8 encoding issues.
9+
10+
By default input is expected from standard in and output is sent to
11+
standard out (errors to standard error). These can be modified by
12+
appropriate options. The csv file is processed as a stream of rows so
13+
minimal memory is used to operate on the file.
14+
15+
## OPTIONS
16+
17+
```
18+
-comma if set use this character in place of a comma for delimiting cells
19+
-comment-char if set, rows starting with this character will be ignored as comments
20+
-example display example(s)
21+
-fields-per-row set the number of columns to output right padding empty cells as needed
22+
-h display help
23+
-help display help
24+
-i input filename
25+
-input input filename
26+
-l display license
27+
-left-trim-spaces If set to true leading white space in a field is ignored.
28+
-license display license
29+
-o output filename
30+
-output output filename
31+
-output-comma if set use this character in place of a comma for delimiting output cells
32+
-reuse if false then a new array is allocated for each row processed, if true the array gets reused
33+
-right-trim-spaces If set to true trailing white space in a field is ignored.
34+
-stop-on-error exit on error, useful if you're trying to debug a problematic CSV file
35+
-trim-spaces If set to true leading and trailing white space in a field is ignored.
36+
-use-crlf if set use a charage return and line feed in output
37+
-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.
38+
-v display version
39+
-verbose write verbose output to standard error
40+
-version display version
41+
```
42+
43+
44+
## EXAMPLES
45+
46+
Normalizing a spread sheet's column count to 5 padding columns as needed per row.
47+
48+
```shell
49+
cat mysheet.csv | csvcleaner -field-per-row=5
50+
```
51+
52+
Trim leading spaces.
53+
54+
```shell
55+
cat mysheet.csv | csvcleaner -left-trim-spaces
56+
```
57+
58+
Trim trailing spaces.
59+
60+
```shell
61+
cat mysheet.csv | csvcleaner -right-trim-spaces
62+
```
63+
64+
Trim leading and trailing spaces
65+
66+
```shell
67+
cat mysheet.csv | csvcleaner -trim-spaces
68+
```
69+
70+
csvcleaner v0.0.17

0 commit comments

Comments
 (0)