Skip to content

Commit d454780

Browse files
committed
updated docs to reflect counting columns from 1 rather than zero
1 parent a440dda commit d454780

File tree

8 files changed

+167
-107
lines changed

8 files changed

+167
-107
lines changed

docs/csvcols.html

Lines changed: 36 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,54 +20,60 @@
2020
</nav>
2121

2222
<section>
23-
<h1>csvcols</h1>
23+
<p>USAGE: csvcols [OPTIONS] ARGS_AS_COLS</p>
2424

25-
<h2>USAGE</h2>
26-
27-
<pre><code>csvcols [OPTIONS] ARGS_AS_COLS
28-
</code></pre>
29-
30-
<h2>SYNOPSIS</h2>
25+
<p>SYNOPSIS</p>
3126

3227
<p>csvcols converts a set of command line args into columns output in CSV format.
3328
It can also be used to filter input CSV and rendering only the column numbers
34-
listed on the commandline.</p>
35-
36-
<h2>OPTIONS</h2>
37-
38-
<pre><code> -d set delimiter for conversion
39-
-delimiter set delimiter for conversion
40-
-f filter CSV input for columns requested
41-
-filter-columns filter CSV input for columns requested
42-
-h display help
43-
-help display help
44-
-l display license
45-
-license display license
46-
-v display version
47-
-version display version
29+
listed on the commandline (first column is 1 not 0)</p>
30+
31+
<p>OPTIONS</p>
32+
33+
<pre><code>-col filter CSV input for columns requested
34+
-d set delimiter for conversion
35+
-delimiter set delimiter for conversion
36+
-filter-columns filter CSV input for columns requested
37+
-h display help
38+
-help display help
39+
-i input filename
40+
-input input filename
41+
-l display license
42+
-license display license
43+
-o output filename
44+
-output output filename
45+
-v display version
46+
-version display version
4847
</code></pre>
4948

50-
<h2>EXAMPLES</h2>
49+
<p>EXAMPLES</p>
5150

5251
<p>Simple usage of building a CSV file one row at a time.</p>
5352

54-
<pre><code> csvcols one two three &gt; 3col.csv
55-
csvcols 1 2 3 &gt;&gt; 3col.csv
56-
cat 3col.csv
53+
<pre><code>csvcols one two three &gt; 3col.csv
54+
csvcols 1 2 3 &gt;&gt; 3col.csv
55+
cat 3col.csv
5756
</code></pre>
5857

5958
<p>Example parsing a pipe delimited string into a CSV line</p>
6059

61-
<pre><code> csvcols -d &quot;|&quot; &quot;one|two|three&quot; &gt; 3col.csv
62-
csvcols -delimiter &quot;|&quot; &quot;1|2|3&quot; &gt;&gt; 3col.csv
63-
cat 3col.csv
60+
<pre><code>csvcols -d &quot;|&quot; &quot;one|two|three&quot; &gt; 3col.csv
61+
csvcols -delimiter &quot;|&quot; &quot;1|2|3&quot; &gt;&gt; 3col.csv
62+
cat 3col.csv
6463
</code></pre>
6564

66-
<p>Filter a 10 column CSV file for columns 0,3,5 (left most column is number zero)</p>
65+
<p>Filter a 10 column CSV file for columns 1,4,6 (left most column is number zero)</p>
6766

68-
<pre><code> cat 10col.csv | csvcols -f 0 3 5 &gt; 3col.csv
67+
<pre><code>cat 10col.csv | csvcols -col 1 4 6 &gt; 3col.csv
6968
</code></pre>
7069

70+
<p>Filter a 10 columns CSV file for columns 1,4,6 from input file</p>
71+
72+
<pre><code>csvcols -i 10col.csv -col 1 4 6 &gt; 3col.csv
73+
</code></pre>
74+
75+
<p>csvcols v0.0.8</p>
76+
7177
</section>
7278

7379
<footer>

docs/csvcols.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,23 @@
99

1010
csvcols converts a set of command line args into columns output in CSV format.
1111
It can also be used to filter input CSV and rendering only the column numbers
12-
listed on the commandline.
12+
listed on the commandline (first column is 1 not 0)
1313

1414
## OPTIONS
1515

1616
```
17+
-col filter CSV input for columns requested
1718
-d set delimiter for conversion
1819
-delimiter set delimiter for conversion
19-
-f filter CSV input for columns requested
2020
-filter-columns filter CSV input for columns requested
2121
-h display help
2222
-help display help
23+
-i input filename
24+
-input input filename
2325
-l display license
2426
-license display license
27+
-o output filename
28+
-output output filename
2529
-v display version
2630
-version display version
2731
```
@@ -30,22 +34,30 @@ listed on the commandline.
3034

3135
Simple usage of building a CSV file one row at a time.
3236

33-
```
37+
```shell
3438
csvcols one two three > 3col.csv
3539
csvcols 1 2 3 >> 3col.csv
3640
cat 3col.csv
3741
```
3842

3943
Example parsing a pipe delimited string into a CSV line
4044

41-
```
45+
```shell
4246
csvcols -d "|" "one|two|three" > 3col.csv
4347
csvcols -delimiter "|" "1|2|3" >> 3col.csv
4448
cat 3col.csv
4549
```
4650

47-
Filter a 10 column CSV file for columns 0,3,5 (left most column is number zero)
51+
Filter a 10 column CSV file for columns 1,4,6 (left most column is number zero)
4852

53+
```shell
54+
cat 10col.csv | csvcols -col 1 4 6 > 3col.csv
4955
```
50-
cat 10col.csv | csvcols -f 0 3 5 > 3col.csv
56+
57+
Filter a 10 columns CSV file for columns 1,4,6 from input file
58+
59+
```shell
60+
csvcols -i 10col.csv -col 1 4 6 > 3col.csv
5161
```
62+
63+

docs/csvfind.html

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,66 +20,66 @@
2020
</nav>
2121

2222
<section>
23-
<h1>csvfind</h1>
23+
<p>USAGE: csvfind [OPTIONS] TEXT_TO_MATCH</p>
2424

25-
<h2>USAGE</h2>
26-
27-
<pre><code>csvfind [OPTIONS] TEXT_TO_MATCH
28-
</code></pre>
29-
30-
<h2>SYNOPSIS</h2>
25+
<p>SYNOPSIS</p>
3126

3227
<p>csvfind processes a CSV file as input returning rows that contain the column
33-
with matched text. Supports exact match as well as some Levenshtein matching.</p>
34-
35-
<h2>OPTIONS</h2>
36-
37-
<pre><code> -append-edit-distance append column with edit distance found (useful for tuning levenshtein)
38-
-case-sensitive perform a case sensitive match (default is false)
39-
-col column to search for match in the CSV file
40-
-contains use contains phrase for matching
41-
-delete-cost set the delete cost to use for levenshtein matching
42-
-h display help
43-
-help display help
44-
-i input filename
45-
-input input filename
46-
-insert-cost set the insert cost to use for levenshtein matching
47-
-l display license
48-
-levenshtein use levenshtein matching
49-
-license display license
50-
-max-edit-distance set the edit distance thresh hold for match, default 0
51-
-o output filename
52-
-output output filename
53-
-skip-header-row skip the header row
54-
-stop-words use the colon delimited list of stop words
55-
-substitute-cost set the substitution cost to use for levenshtein matching
56-
-v display version
57-
-version display version
28+
with matched text. Columns are count from one instead of zero. Supports
29+
exact match as well as some Levenshtein matching.</p>
30+
31+
<p>OPTIONS</p>
32+
33+
<pre><code>-allow-duplicates allow duplicates when searching for matches
34+
-append-edit-distance append column with edit distance found (useful for tuning levenshtein)
35+
-case-sensitive perform a case sensitive match (default is false)
36+
-col column to search for match in the CSV file
37+
-contains use contains phrase for matching
38+
-delete-cost set the delete cost to use for levenshtein matching
39+
-h display help
40+
-help display help
41+
-i input filename
42+
-input input filename
43+
-insert-cost set the insert cost to use for levenshtein matching
44+
-l display license
45+
-levenshtein use levenshtein matching
46+
-license display license
47+
-max-edit-distance set the edit distance thresh hold for match, default 0
48+
-o output filename
49+
-output output filename
50+
-skip-header-row skip the header row
51+
-stop-words use the colon delimited list of stop words
52+
-substitute-cost set the substitution cost to use for levenshtein matching
53+
-trim-spaces trim spaces around cell values before comparing
54+
-v display version
55+
-version display version
5856
</code></pre>
5957

60-
<h2>EXAMPLES</h2>
58+
<p>EXAMPLES</p>
6159

6260
<p>Find the rows where the third column matches &ldquo;The Red Book of Westmarch&rdquo; exactly</p>
6361

64-
<pre><code class="language-shell"> csvfind -i books.csv -col=1 &quot;The Red Book of Westmarch&quot;
62+
<pre><code>csvfind -i books.csv -col=2 &quot;The Red Book of Westmarch&quot;
6563
</code></pre>
6664

6765
<p>Find the rows where the third column (colums numbered 0,1,2) matches approximately
6866
&ldquo;The Red Book of Westmarch&rdquo;</p>
6967

70-
<pre><code class="language-shell"> csvfind -i books.csv -col=1 -levenshtein \
71-
-insert-cost=1 -delete-cost=1 -substitute-cost=3 \
72-
-max-edit-distance=50 -append-edit-distance \
73-
&quot;The Red Book of Westmarch&quot;
68+
<pre><code>csvfind -i books.csv -col=2 -levenshtein \
69+
-insert-cost=1 -delete-cost=1 -substitute-cost=3 \
70+
-max-edit-distance=50 -append-edit-distance \
71+
&quot;The Red Book of Westmarch&quot;
7472
</code></pre>
7573

7674
<p>In this example we&rsquo;ve appended the edit distance to see how close the matches are.</p>
7775

7876
<p>You can also search for phrases in columns.</p>
7977

80-
<pre><code class="language-shell"> csvfind -i books.csv -col=1 -contains &quot;Red Book&quot;
78+
<pre><code>csvfind -i books.csv -col=2 -contains &quot;Red Book&quot;
8179
</code></pre>
8280

81+
<p>csvfind v0.0.8</p>
82+
8383
</section>
8484

8585
<footer>

docs/csvfind.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
## SYNOPSIS
99

1010
csvfind processes a CSV file as input returning rows that contain the column
11-
with matched text. Supports exact match as well as some Levenshtein matching.
11+
with matched text. Columns are count from one instead of zero. Supports
12+
exact match as well as some Levenshtein matching.
1213

1314
## OPTIONS
1415

1516
```
17+
-allow-duplicates allow duplicates when searching for matches
1618
-append-edit-distance append column with edit distance found (useful for tuning levenshtein)
1719
-case-sensitive perform a case sensitive match (default is false)
1820
-col column to search for match in the CSV file
@@ -32,6 +34,7 @@ with matched text. Supports exact match as well as some Levenshtein matching.
3234
-skip-header-row skip the header row
3335
-stop-words use the colon delimited list of stop words
3436
-substitute-cost set the substitution cost to use for levenshtein matching
37+
-trim-spaces trim spaces around cell values before comparing
3538
-v display version
3639
-version display version
3740
```
@@ -41,14 +44,14 @@ with matched text. Supports exact match as well as some Levenshtein matching.
4144
Find the rows where the third column matches "The Red Book of Westmarch" exactly
4245

4346
```shell
44-
csvfind -i books.csv -col=1 "The Red Book of Westmarch"
47+
csvfind -i books.csv -col=2 "The Red Book of Westmarch"
4548
```
4649

4750
Find the rows where the third column (colums numbered 0,1,2) matches approximately
4851
"The Red Book of Westmarch"
4952

5053
```shell
51-
csvfind -i books.csv -col=1 -levenshtein \
54+
csvfind -i books.csv -col=2 -levenshtein \
5255
-insert-cost=1 -delete-cost=1 -substitute-cost=3 \
5356
-max-edit-distance=50 -append-edit-distance \
5457
"The Red Book of Westmarch"
@@ -59,6 +62,7 @@ In this example we've appended the edit distance to see how close the matches ar
5962
You can also search for phrases in columns.
6063

6164
```shell
62-
csvfind -i books.csv -col=1 -contains "Red Book"
65+
csvfind -i books.csv -col=2 -contains "Red Book"
6366
```
6467

68+

docs/csvjoin.html

Lines changed: 36 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,55 @@
2020
</nav>
2121

2222
<section>
23-
<h1>csvjoin</h1>
23+
<p>USAGE: csvjoin [OPTIONS] CSV1 CSV2 COL1 COL2</p>
2424

25-
<h2>USAGE</h2>
25+
<p>SYNOPSIS</p>
2626

27-
<pre><code>csvjoin [OPTIONS] CSV1 CSV2 COL1 COL2
28-
</code></pre>
29-
30-
<h2>SYNOPSIS</h2>
31-
32-
<p>csvjoin outputs CSV content based on two CSV files with match column values.
27+
<p>csvjoin outputs CSV content based on two CSV files with matching column values.
3328
Each CSV input file has a designated column to match on. The values are
34-
compared as strings.</p>
29+
compared as strings. Columns are counted from one rather than zero.</p>
3530

36-
<h2>OPTIONS</h2>
31+
<p>OPTIONS</p>
3732

38-
<pre><code> -h display help
39-
-help display help
40-
-l display license
41-
-license display license
42-
-v display version
43-
-version display version
33+
<pre><code>-allow-duplicates allow duplicates when searching for matches
34+
-case-sensitive make a case sensitive match (default is case insensitive)
35+
-col1 column to on join on in first CSV file
36+
-col2 column to on join on in second CSV file
37+
-contains match columns based on csv1/col1 contained in csv2/col2
38+
-csv1 first CSV filename
39+
-csv2 second CSV filename
40+
-delete-cost deletion cost to use when calculating Levenshtein edit distance
41+
-h display help
42+
-help display help
43+
-insert-cost insertion cost to use when calculating Levenshtein edit distance
44+
-l display license
45+
-levenshtein match columns using Levensthein edit distance
46+
-license display license
47+
-max-edit-distance maximum edit distance for match using Levenshtein distance
48+
-o output filename
49+
-output output filename
50+
-stop-words a column delimited list of stop words to ingnore when matching
51+
-substitute-cost substitution cost to use when calculating Levenshtein edit distance
52+
-trim-spaces trim spaces around cell values before comparing
53+
-v display version
54+
-verbose output processing count to stderr
55+
-version display version
4456
</code></pre>
4557

46-
<h2>EXAMPLES</h2>
58+
<p>EXAMPLES</p>
4759

4860
<p>Simple usage of building a merged CSV file from data1.csv
4961
and data2.csv where column 1 in data1.csv matches the value in
50-
column 3 of data2.csv.</p>
62+
column 3 of data2.csv with the results being written to
63+
merged-data.csv..</p>
5164

52-
<pre><code> csvjoin data1.csv data2.csv 1 3 &gt; merged-data.csv
65+
<pre><code>csvjoin -csv1=data1.csv -col1=2 \
66+
-csv2=data2.csv -col2=4 \
67+
-output=merged-data.csv
5368
</code></pre>
5469

70+
<p>csvjoin v0.0.8</p>
71+
5572
</section>
5673

5774
<footer>

0 commit comments

Comments
 (0)