Skip to content

Commit 33cbb95

Browse files
committed
re-organize docs and examples
1 parent 5a42fe6 commit 33cbb95

File tree

62 files changed

+1606
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1606
-0
lines changed

docs/csv2json/index.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
# USAGE
3+
4+
csv2json [OPTIONS]
5+
6+
## SYNOPSIS
7+
8+
9+
csv2json reads CSV from stdin and writes a JSON to stdout. JSON output
10+
can be either an array of JSON blobs or one JSON blob (row as object)
11+
per line.
12+
13+
14+
## OPTIONS
15+
16+
```
17+
-as-blobs output as one JSON blob per line
18+
-d, -delimiter set the delimter character
19+
-examples display example(s)
20+
-generate-markdown-docs generation markdown documentation
21+
-h, -help display help
22+
-i, -input input filename
23+
-l, -license display license
24+
-nl, -newline include trailing newline in output
25+
-o, -output output filename
26+
-quiet suppress error output
27+
-use-header treat the first row as field names
28+
-v, -version display version
29+
```
30+
31+
32+
## EXAMPLES
33+
34+
35+
Convert data1.csv to data1.json using Unix pipes.
36+
37+
cat data1.csv | csv2json > data1.json
38+
39+
Convert data1.csv to JSON blobs, one line per blob
40+
41+
csv2json -as-blobs -i data1.csv
42+
43+
44+
csv2json v0.0.20-pre

docs/csv2json/nav.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+ [Home](/)
2+
+ [README](../../index.html)
3+
+ [Documentation](../../docs/)
4+
+ [How To](../../how-to/)
5+
+ [Installation](../../INSTALL.html)
6+
+ [Github](https://github.com/caltechlibrary/datatools)

docs/csv2mdtable/index.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
2+
# USAGE
3+
4+
csv2mdtable [OPTIONS]
5+
6+
## SYNOPSIS
7+
8+
9+
csv2mdtable reads CSV from stdin and writes a Github Flavored Markdown
10+
table to stdout.
11+
12+
13+
## OPTIONS
14+
15+
```
16+
-d, -delimiter set delimiter character
17+
-examples display example(s)
18+
-generate-markdown-docs generate markdown documentation
19+
-h, -help display help
20+
-i, -input input filename
21+
-l, -license display license
22+
-nl, -newline if true include leading/trailing newline
23+
-o, -output output filename
24+
-quiet suppress error message
25+
-v, -version display version
26+
```
27+
28+
29+
## EXAMPLES
30+
31+
32+
Convert data1.csv to data1.md using Unix pipes.
33+
34+
cat data1.csv | csv2mdtable > data1.md
35+
36+
Convert data1.csv to data1.md using options.
37+
38+
csv2mdtable -i data1.csv -o data1.md
39+
40+
41+
csv2mdtable v0.0.20-pre

docs/csv2mdtable/nav.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+ [Home](/)
2+
+ [README](../../index.html)
3+
+ [Documentation](../../docs/)
4+
+ [How To](../../how-to/)
5+
+ [Installation](../../INSTALL.html)
6+
+ [Github](https://github.com/caltechlibrary/datatools)

docs/csv2xlsx/index.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
# USAGE
3+
4+
csv2xlsx [OPTIONS] WORKBOOK_NAME SHEET_NAME
5+
6+
## SYNOPSIS
7+
8+
9+
csv2xlsx will take CSV input and create a new sheet in an Excel Workbook.
10+
If the Workbook does not exist then it is created.
11+
12+
13+
## OPTIONS
14+
15+
```
16+
-d, -delimiter set delimiter character (input)
17+
-examples display example(s)
18+
-generate-markdown-docs generate markdown documentation
19+
-h, -help display help
20+
-i, -input input filename (CSV content)
21+
-l, -license display license
22+
-o, -output output filename
23+
-quiet suppress error messages
24+
-sheet Sheet name to create/replace
25+
-v, -version display version
26+
-workbook Workbook name
27+
```
28+
29+
30+
## EXAMPLES
31+
32+
33+
Converting a csv to a workbook.
34+
35+
csv2xlsx -i data.csv MyWorkbook.xlsx 'My worksheet 1'
36+
37+
This creates a new 'My worksheet 1' in the Excel Workbook
38+
called 'MyWorkbook.xlsx' with the contents of data.csv.
39+
40+
cat data.csv | csv2xlsx MyWorkbook.xlsx 'My worksheet 2'
41+
42+
This does the same but the contents of data.csv are piped into
43+
the workbook's 'My worksheet 2' sheet.
44+
%!(EXTRA string=csv2xlsx, string=csv2xlsx)
45+
46+
csv2xlsx v0.0.20-pre

docs/csv2xlsx/nav.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+ [Home](/)
2+
+ [README](../../index.html)
3+
+ [Documentation](../../docs/)
4+
+ [How To](../../how-to/)
5+
+ [Installation](../../INSTALL.html)
6+
+ [Github](https://github.com/caltechlibrary/datatools)

docs/csvcleaner/index.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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

docs/csvcleaner/nav.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+ [Home](/)
2+
+ [README](../../index.html)
3+
+ [Documentation](../../docs/)
4+
+ [How To](../../how-to/)
5+
+ [Installation](../../INSTALL.html)
6+
+ [Github](https://github.com/caltechlibrary/datatools)

docs/csvcols/index.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
# USAGE
3+
4+
csvcols [OPTIONS] [ARGS_AS_COL_VALUES]
5+
6+
## SYNOPSIS
7+
8+
9+
csvcols converts a set of command line args into columns output in CSV format.
10+
It can also be used CSV input rows and rendering only the column numbers
11+
listed on the commandline (first column is 1 not 0).
12+
13+
14+
## OPTIONS
15+
16+
```
17+
-col, -cols output specified columns (e.g. -col 1,12:14,2,4))
18+
-d, -delimiter set the input delimiter character
19+
-examples display example
20+
-generate-markdown-docs generate markdown documentation
21+
-h, -help display help
22+
-i, -input input filename
23+
-l, -license display license
24+
-o, -output output filename
25+
-od, -output-delimiter set the output delimiter character
26+
-quiet suppress error messages
27+
-skip-header-row skip the header row
28+
-uuid add a prefix row with generated UUID cell
29+
-v, -version display version
30+
```
31+
32+
33+
## EXAMPLES
34+
35+
36+
Simple usage of building a CSV file one row at a time.
37+
38+
csvcols one two three > 3col.csv
39+
csvcols 1 2 3 >> 3col.csv
40+
cat 3col.csv
41+
42+
Example parsing a pipe delimited string into a CSV line
43+
44+
csvcols -d "|" "one|two|three" > 3col.csv
45+
csvcols -delimiter "|" "1|2|3" >> 3col.csv
46+
cat 3col.csv
47+
48+
Using a pipe filter a 3 column CSV for columns 1 and 3 into 2col.csv
49+
50+
cat 3col.csv | csvcols -col 1,3 > 2col.csv
51+
52+
Using options filter a 3 column CSV file for columns 1,3 into 2col.csv
53+
54+
csvcols -i 3col.csv -col 1,3 -o 2col.csv
55+
56+
57+
csvcols v0.0.20-pre

docs/csvcols/nav.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+ [Home](/)
2+
+ [README](../../index.html)
3+
+ [Documentation](../../docs/)
4+
+ [How To](../../how-to/)
5+
+ [Installation](../../INSTALL.html)
6+
+ [Github](https://github.com/caltechlibrary/datatools)

0 commit comments

Comments
 (0)