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