Skip to content

Commit 1377ba0

Browse files
committed
Quick Save
1 parent 645f853 commit 1377ba0

File tree

10 files changed

+286
-52
lines changed

10 files changed

+286
-52
lines changed

docs/csvcols.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ <h2>SYNOPSIS</h2>
3535

3636
<h2>OPTIONS</h2>
3737

38-
<pre><code> -col filter CSV input for columns requested
39-
-d set delimiter for conversion
40-
-delimiter set delimiter for conversion
41-
-filter-columns filter CSV input for columns requested
42-
-h display help
43-
-help display help
44-
-i input filename
45-
-input input filename
46-
-l display license
47-
-license display license
48-
-o output filename
49-
-output output filename
50-
-v display version
51-
-version display version
38+
<pre><code> -col filter CSV input for columns requested
39+
-cols filter CSV input for columns requested
40+
-d set delimiter for conversion
41+
-delimiter set delimiter for conversion
42+
-h display help
43+
-help display help
44+
-i input filename
45+
-input input filename
46+
-l display license
47+
-license display license
48+
-o output filename
49+
-output output filename
50+
-v display version
51+
-version display version
5252
</code></pre>
5353

5454
<h2>EXAMPLES</h2>
@@ -69,12 +69,12 @@ <h2>EXAMPLES</h2>
6969

7070
<p>Filter a 10 column CSV file for columns 1,4,6 (left most column is number zero)</p>
7171

72-
<pre><code class="language-shell"> cat 10col.csv | csvcols -col 1 4 6 &gt; 3col.csv
72+
<pre><code class="language-shell"> cat 10col.csv | csvcols -col 1,4,6 &gt; 3col.csv
7373
</code></pre>
7474

7575
<p>Filter a 10 columns CSV file for columns 1,4,6 from input file</p>
7676

77-
<pre><code class="language-shell"> csvcols -i 10col.csv -col 1 4 6 &gt; 3col.csv
77+
<pre><code class="language-shell"> csvcols -i 10col.csv -col 1,4,6 &gt; 3col.csv
7878
</code></pre>
7979

8080
</section>

docs/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,23 @@
2222
<section>
2323
<h1>datatools command help</h1>
2424

25+
<ul>
26+
<li><a href="cmds.html">cmds</a></li>
27+
<li><a href="csvrows.html">csvrows</a></li>
28+
<li><a href="csvjoin.html">csvjoin</a></li>
29+
<li><a href="csv2xlsx.html">csv2xlsx</a></li>
30+
<li><a href="csvfind.html">csvfind</a></li>
31+
<li><a href="jsonmunge.html">jsonmunge</a></li>
32+
<li><a href="csv2json.html">csv2json</a></li>
33+
<li><a href="jsoncols.html">jsoncols</a></li>
34+
<li><a href="vcard2json.html">vcard2json</a></li>
35+
<li><a href="xlsx2csv.html">xlsx2csv</a></li>
36+
<li><a href="csv2mdtable.html">csv2mdtable</a></li>
37+
<li><a href="csvcols.html">csvcols</a></li>
38+
<li><a href="jsonrange.html">jsonrange</a></li>
39+
<li><a href="xlsx2json.html">xlsx2json</a></li>
40+
</ul>
41+
2542
</section>
2643

2744
<footer>

docs/index.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11

22
# datatools command help
33

4+
+ [cmds](cmds.html)
5+
+ [csvrows](csvrows.html)
6+
+ [csvjoin](csvjoin.html)
7+
+ [csv2xlsx](csv2xlsx.html)
8+
+ [csvfind](csvfind.html)
9+
+ [jsonmunge](jsonmunge.html)
10+
+ [csv2json](csv2json.html)
11+
+ [jsoncols](jsoncols.html)
12+
+ [vcard2json](vcard2json.html)
13+
+ [xlsx2csv](xlsx2csv.html)
14+
+ [csv2mdtable](csv2mdtable.html)
15+
+ [csvcols](csvcols.html)
16+
+ [jsonrange](jsonrange.html)
17+
+ [xlsx2json](xlsx2json.html)

docs/jsoncols.html

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,17 @@
2222
<section>
2323
<h1>jsoncols</h1>
2424

25-
<h2>USAGE</h2>
25+
<h2>USAGE:</h2>
2626

2727
<pre><code>jsoncols [OPTIONS] [EXPRESSION] [INPUT_FILENAME] [OUTPUT_FILENAME]
2828
</code></pre>
2929

3030
<h2>SYSNOPSIS</h2>
3131

32-
<p>jsoncols provides for both interactive exploration of JSON structures like jid
33-
and command line scripting flexibility for data extraction into delimited
34-
columns. This is helpful in flattening content extracted from JSON blobs.
35-
The default delimiter for each value extracted is a comma. This can be
36-
overridden with an option.</p>
32+
<p>jsoncols provides scripting flexibility for data extraction from JSON data
33+
returning the results in columns. This is helpful in flattening content
34+
extracted from JSON blobs. The default delimiter for each value
35+
extracted is a comma. This can be overridden with an option.</p>
3736

3837
<ul>
3938
<li>EXPRESSION can be an empty stirng or dot notation for an object&rsquo;s path</li>
@@ -53,15 +52,18 @@ <h2>SYSNOPSIS</h2>
5352

5453
<h2>OPTIONS</h2>
5554

56-
<pre><code> -d set the delimiter for multi-field output
57-
-h display help
58-
-i read JSON from a file
59-
-input read JSON from a file
60-
-l display license
61-
-m display output in monochrome
62-
-r run interactively
63-
-repl run interactively
64-
-v display version
55+
<pre><code> -d set the delimiter for multi-field output
56+
-h display help
57+
-i input filename
58+
-input input filename
59+
-l display license
60+
-m display output in monochrome
61+
-o output filename
62+
-output output filename
63+
-permissive suppress error messages
64+
-r run interactively
65+
-repl run interactively
66+
-v display version
6567
</code></pre>
6668

6769
<h2>EXAMPLES</h2>
@@ -73,7 +75,7 @@ <h2>EXAMPLES</h2>
7375

7476
<p>Getting just the name could be done with</p>
7577

76-
<pre><code> jsoncols .name myblob.json
78+
<pre><code class="language-shell"> jsoncols -i myblob.json .name
7779
</code></pre>
7880

7981
<p>This would yeild</p>
@@ -85,14 +87,26 @@ <h2>EXAMPLES</h2>
8587
easy as listing each field in the expression inside a
8688
space delimited string.</p>
8789

88-
<pre><code> jsoncols -d\| &quot;.name .age&quot; myblob.json
90+
<pre><code class="language-shell"> jsoncols -i myblob.json -d\| .name .age
8991
</code></pre>
9092

9193
<p>This would yeild</p>
9294

9395
<pre><code> &quot;Doe, Jane&quot;|42
9496
</code></pre>
9597

98+
<p>You can also pipe JSON data in.</p>
99+
100+
<pre><code class="language-shell"> cat myblob.json | jsoncols .name .email .age
101+
</code></pre>
102+
103+
<p>Would yield</p>
104+
105+
<pre><code> &quot;Doe, Jane&quot;,[email protected],42
106+
</code></pre>
107+
108+
<p>jsoncols v0.0.9</p>
109+
96110
</section>
97111

98112
<footer>

docs/jsonmunge.html

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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+
<p>USAGE: jsonmunge [OPTIONS] TEMPLATE_FILENAME</p>
24+
25+
<p>SYSNOPSIS</p>
26+
27+
<p>jsonmunge is a command line tool that takes a JSON document and
28+
one or more Go templates rendering the results. Useful for
29+
reshaping a JSON document, transforming into a new format,
30+
or filter for specific content.</p>
31+
32+
<ul>
33+
<li>TEMPLATE_FILENAME is the name of a Go text tempate file used to render
34+
the outbound JSON document</li>
35+
</ul>
36+
37+
<p>OPTIONS</p>
38+
39+
<pre><code>-h display help
40+
-i input filename
41+
-input input filename
42+
-l display license
43+
-o output filename
44+
-output output filename
45+
-v display version
46+
</code></pre>
47+
48+
<p>EXAMPLES</p>
49+
50+
<p>If data.json contained</p>
51+
52+
<p>{&ldquo;name&rdquo;: &ldquo;Doe, Jane&rdquo;, &ldquo;email&rdquo;:&ldquo;[email protected]&rdquo;, &ldquo;age&rdquo;: 42}</p>
53+
54+
<p>and the template, name.tmpl, contained</p>
55+
56+
<p>{{- .name -}}</p>
57+
58+
<p>Getting just the name could be done with</p>
59+
60+
<pre><code>cat data.json | jsonmunge name.tmpl
61+
</code></pre>
62+
63+
<p>This would yeild</p>
64+
65+
<pre><code>&quot;Doe, Jane&quot;
66+
</code></pre>
67+
68+
<p>jsonmunge v0.0.9</p>
69+
70+
</section>
71+
72+
<footer>
73+
<span><h1><A href="http://caltech.edu">Caltech</a></h1></span>
74+
<span>&copy; 2017 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
75+
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
76+
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
77+
<span><a href="mailto:[email protected]">Email Us</a></span>
78+
<a class="cl-hide" href="sitemap.xml">Site Map</a>
79+
</footer>
80+
</body>
81+
</html>

docs/jsonrange.html

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,33 +46,34 @@ <h2>SYSNOPSIS</h2>
4646
E.g.</p>
4747

4848
<ul>
49-
<li><em>.</em> would indicate the whole JSON data structure read is used to range over</li>
50-
<li><em>.name</em> would indicate to range over the value pointed at by the &ldquo;name&rdquo; attribute</li>
51-
<li><em>[&ldquo;name&rdquo;]</em> would indicate to range over the value pointed at by the &ldquo;name&rdquo; attribute</li>
52-
<li><em>[0]</em> would indicate to range over the value held in the zero-th element of the array</li>
49+
<li>. would indicate the whole JSON data structure read is used to range over</li>
50+
<li>.name would indicate to range over the value pointed at by the &ldquo;name&rdquo; attribute</li>
51+
<li>[&ldquo;name&rdquo;] would indicate to range over the value pointed at by the &ldquo;name&rdquo; attribute</li>
52+
<li>[0] would indicate to range over the value held in the zero-th element of the array</li>
5353
</ul>
5454

5555
<p>The path can be chained together</p>
5656

5757
<ul>
58-
<li><em>.name.family</em> would point to the value heald by the &ldquo;name&rdquo; attributes&rsquo; &ldquo;family&rdquo; attribute.</li>
58+
<li>.name.family would point to the value heald by the &ldquo;name&rdquo; attributes&rsquo; &ldquo;family&rdquo; attribute.</li>
5959
</ul>
6060

6161
<h2>OPTIONS</h2>
6262

63-
<pre><code> -d set delimiter for range output
63+
<pre><code> -d set delimiter for range output
6464
-delimiter set delimiter for range output
65-
-h display help
66-
-i read JSON from file
67-
-input read JSON from file
68-
-l display license
69-
-last return the index of the last element in list (e.g. length - 1)
70-
-length return the number of keys or values
71-
-limit limit the number of items output
72-
-o write to output file
73-
-output write to output file
74-
-v display version
75-
-values return the values instead of the keys
65+
-h display help
66+
-i read JSON from file
67+
-input read JSON from file
68+
-l display license
69+
-last return the index of the last element in list (e.g. length - 1)
70+
-length return the number of keys or values
71+
-limit limit the number of items output
72+
-o write to output file
73+
-output write to output file
74+
-permissive suppress errors messages
75+
-v display version
76+
-values return the values instead of the keys
7677
</code></pre>
7778

7879
<h2>EXAMPLES</h2>
@@ -158,6 +159,8 @@ <h2>EXAMPLES</h2>
158159
2
159160
</code></pre>
160161

162+
<p>jsonrange v0.0.9</p>
163+
161164
</section>
162165

163166
<footer>

docs/vcard2json.html

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
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+
<p>USAGE: vcard2json [OPTIONS]</p>
24+
25+
<p>SYNOPSIS</p>
26+
27+
<p>vcard2json converts a VCard to JSON. The vcard can be read from stdin or form a file
28+
with the usual options. The JSON version will be written to stdout.</p>
29+
30+
<p>OPTIONS</p>
31+
32+
<pre><code>-h display help
33+
-help display help
34+
-i input filename
35+
-input input filename
36+
-l display license
37+
-license display license
38+
-o output filename
39+
-output output filename
40+
-v display version
41+
-version display version
42+
</code></pre>
43+
44+
<p>EXAMPLES</p>
45+
46+
<p>Simple usage of building a CSV file one rows at a time.</p>
47+
48+
<pre><code>cat my.cvf | vcard2json &gt; myVCard.json
49+
</code></pre>
50+
51+
<p>Or reading, writing to specific file</p>
52+
53+
<pre><code>vcard2json -i mv.cvf -o myVCard.json
54+
</code></pre>
55+
56+
<p>vcard2json v0.0.9</p>
57+
58+
</section>
59+
60+
<footer>
61+
<span><h1><A href="http://caltech.edu">Caltech</a></h1></span>
62+
<span>&copy; 2017 <a href="https://www.library.caltech.edu/copyright">Caltech library</a></span>
63+
<address>1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200</address>
64+
<span>Phone: <a href="tel:+1-626-395-3405">(626)395-3405</a></span>
65+
<span><a href="mailto:[email protected]">Email Us</a></span>
66+
<a class="cl-hide" href="sitemap.xml">Site Map</a>
67+
</footer>
68+
</body>
69+
</html>

0 commit comments

Comments
 (0)