diff --git a/Makefile b/Makefile
index b7effa9..efe751b 100644
--- a/Makefile
+++ b/Makefile
@@ -70,9 +70,8 @@ $(MAN_PAGES): .FORCE
man: $(MAN_PAGES)
-website:
- bash gen-nav.bash
- bash mk-website.bash
+website: .FORCE
+ make -f website.mak
status:
git status
diff --git a/README.md b/README.md
index b2fbdf3..2223d5c 100644
--- a/README.md
+++ b/README.md
@@ -2,46 +2,54 @@
datatools
=========
-_datatools_ provides a variety of command line programs for working with
-data in different formats as well as to ease Posix shell scripting
-(e.g. writing scripts that run under Bash). The tools are group as data,
-strings and scripting.
-
-For data
---------
-
-Command line utilities for simplifying work with CSV, JSON, TOML, YAML,
-Excel Workbooks and plain text files or content.
-
-+ [csv2json](docs/csv2json/) - a tool to take a CSV file and convert it into a JSON array or a list of JSON blobs one per line
-+ [csv2mdtable](docs/csv2mdtable/) - a tool to render CSV as a Github Flavored Markdown table
-+ [csv2tab](docs/csv2tab/) - a tool to take a CSV file and convert to tab separated values
-+ [csv2xlsx](docs/csv2xlsx/) - a tool to take a CSV file and add it as a sheet to a Excel Workbook
-+ [csvcleaner](docs/csvcleaner/) - normalize a CSV file by column and row including trimming spaces and removing comments
-+ [csvcols](docs/csvcols/) - a tool for formatting command line arguments into CSV row of columns or filtering CSV rows for specific columns
-+ [csvfind](docs/csvfind/) - a tool for filtering a CSV file rows by column
-+ [csvjoin](docs/csvjoin/) - a tool to join two CSV files on common values in designated columns, writes combined CSV rows
-+ [csvrows](docs/csvrows/) - a tool for formatting command line arguments into CSV columns of rows or filtering CSV for specific rows
-+ [json2toml](docs/json2toml/) - a tool for converting JSON to TOML
-+ [json2yaml](docs/json2yaml/) - a tool for converting JSON to YAML
-+ [jsoncols](docs/jsoncols/) - a tool for exploring and extracting JSON values into columns
-+ [jsonjoin](docs/jsonjoin/) - a tool for joining JSON object documents
-+ [jsonmunge](docs/jsonmunge/) - a tool to transform JSON documents into something else
-+ [jsonrange](docs/jsonrange/) - a tool for iterating over JSON objects and arrays (return keys or values)
-+ [tab2csv](docs/tab2csv/) - a tool to convert from tab separated values to comma separated values
-+ [toml2json](docs/toml2json/) - a tool for converting TOML to JSON
-+ [xlsx2csv](docs/xlsx2csv/) - a tool for converting Excel Workbooks sheets to CSV files
-+ [xlsx2json](docs/xlsx2json/) - a tool for converting Excel Workbooks to JSON files
-+ [yaml2json](docs/yaml2json/) - a tool for converting YAML files to JSON
-+ [codemeta2cff](codemeta2cff.1.html) - a tool to convert a codemeta.json file into a CITATION.cff file.
-+ [sql2csv](sql2csv.1.html) - a tool to execute a SQL query in MySQL or SQLIte3 and render the results in CSV encoding
-
-
-Compiled versions are provided for Linux (amd64), Mac OS X (amd64),
-Windows 10 (amd64) and Raspbian (ARM7). See https://github.com/caltechlibrary/datatools/releases.
+_datatools_ is a rich collection of command line programs targetting
+data conversion, cleanup and analysis directly from your favorite
+POSIX shell. It has proven useful for data collaberations where
+individual members of a project may prefer different toolsets in their
+analysis (e.g. Julia, R, Python) but want to work from a common baseline.
+It also has been used intensively for internal reporting from various
+Caltech Library metadata sources.
+
+The tools fall into three broad categories
+
+- data transformation and conversion
+- shell scripting helpers
+- "string", a tool providing the common string operations missing from shell
+
+See [user manual](user-manual.md) for a complete list of the command line
+programs. The data transformation tools include support for formats such as
+Excel XML, csv, tab delimited files, json, yaml and toml.
+
+Compiled versions of the datatools collection are provided for Linux
+(amd64), Mac OS X (amd64), Windows 10 (amd64) and Raspbian (ARM7).
+See https://github.com/caltechlibrary/datatools/releases.
Use "-help" option for a full list of options for each utility (e.g. `csv2json -help`).
+Data transformation
+-------------------
+
+The tooling around transformation includes data conversion. These
+include tools that work with CSV, tab delimited, JSON, TOML, YAML
+and Excel XML.
+
+There is also tooling to change data shapes using JSON as the
+intermediate data format.
+
+For the shell
+-------------
+
+Various utilities for simplifying work on the command line.
+
++ [findfile](docs/findfile/) - find files based on prefix, suffix or contained string
++ [finddir](docs/finddir/) - find directories based on prefix, suffix or contained string
++ [mergepath](docs/mergepath/) - prefix, append, clip path variables
++ [range](docs/range/) - emit a range of integers (useful for numbered loops in Bash)
++ [reldate](docs/reldate/) - display a relative date in YYYY-MM-DD format
++ [reltime](docs/reltime/) - display a relative time in 24 hour notation, HH:MM:SS format
++ [timefmt](docs/timefmt/) - format a time value based on Golang's time format language
++ [urlparse](docs/urlparse/) - split a URL into parts
+
For strings
-----------
@@ -71,26 +79,6 @@ Some of the features included
See [string](docs/string/) for full details
-For scripting
--------------
-
-Various utilities for simplifying work on the command line.
-
-+ [findfile](docs/findfile/) - find files based on prefix, suffix or contained string
-+ [finddir](docs/finddir/) - find directories based on prefix, suffix or contained string
-+ [mergepath](docs/mergepath/) - prefix, append, clip path variables
-+ [range](docs/range/) - emit a range of integers (useful for numbered loops in Bash)
-+ [reldate](docs/reldate/) - display a relative date in YYYY-MM-DD format
-+ [reltime](docs/reltime/) - display a relative time in 24 hour notation, HH:MM:SS format
-+ [timefmt](docs/timefmt/) - format a time value based on Golang's time format language
-+ [urlparse](docs/urlparse/) - split a URL into parts
-
-Compiled versions are provided for Linux (amd64), Mac OS X (amd64),
-Windows 10 (amd64) and Raspbian (ARM7). See https://github.com/caltechlibrary/datatools/releases.
-
-Use the utilities try "-help" option for a full list of options.
-
-
Installation
------------
diff --git a/TODO.html b/TODO.html
index 264b303..c16f70e 100644
--- a/TODO.html
+++ b/TODO.html
@@ -11,365 +11,195 @@
-Action Items
-
-
-Bug
-
+Action Items
+Bug
-
-
-
-
+
-Next
-
+Next
-
-
-
-
+
-Someday, Maybe
-
+Someday, Maybe
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
-
-Completed
-
+numbers as first column)Completed
-
-
-cat file1.csv | csvfind -levenshtein -stop-words=“the:a:of”
--col=1 “This Red Book of West March”
-cat file1.csv | csvfind -inverted -levenstein
--stop-words=“the:a:of” -col=1 “This Red Book of West March”
-cat file1.csv | csvfind -contains -col=1 “Red Book”
-
+
cat file1.csv | csvfind -levenshtein -stop-words="the:a:of" -col=1 "This Red Book of West March"
cat file1.csv | csvfind -inverted -levenstein -stop-words="the:a:of" -col=1 "This Red Book of West March"
cat file1.csv | csvfind -contains -col=1 "Red Book"
-If my.tab contained -
+If my.tab contained
"name","email","age"
"Doe, Jane","jane.doe@example.org",42
--Concert this to a tab separated values -
+Concert this to a tab separated values
csv2tab < my.csv
--This would yield -
+This would yield
name email age
Doe, Jane jane.doe@example.org 42
--csv2tab 1.2.2 -
+csv2tab 1.2.2
-csv2xlsx -
--csv2xlsx OPTIONS WORKBOOK_NAME SHEET_NAME -
--csv2xlsx will take CSV input and create a new sheet in an Excel -Workbook. If the Workbook does not exist then it is created. -
-csv2xlsx
+csv2xlsx OPTIONS WORKBOOK_NAME SHEET_NAME
+csv2xlsx will take CSV input and create a new sheet in an Excel +Workbook. If the Workbook does not exist then it is created.
+-Converting a csv to a workbook. -
+Converting a csv to a workbook.
csv2xlsx -i data.csv MyWorkbook.xlsx 'My worksheet 1'
--This creates a new ‘My worksheet 1’ in the Excel Workbook called -‘MyWorkbook.xlsx’ with the contents of data.csv. -
+This creates a new ‘My worksheet 1’ in the Excel Workbook called +‘MyWorkbook.xlsx’ with the contents of data.csv.
cat data.csv | csv2xlsx MyWorkbook.xlsx 'My worksheet 2'
--This does the same but the contents of data.csv are piped into the -workbook’s ‘My worksheet 2’ sheet. -
--csv2xlsx 1.2.2 -
+This does the same but the contents of data.csv are piped into the +workbook’s ‘My worksheet 2’ sheet.
+csv2xlsx 1.2.2
-csvcleaner -
--csvcleaner OPTIONS -
--csvcleaner normalizes a CSV file based on the options selected. It helps -to address issues like variable number of columns, leading/trailing -spaces in columns, and non-UTF-8 encoding issues. -
--By default input is expected from standard in and output is sent to +
csvcleaner
+csvcleaner OPTIONS
+csvcleaner normalizes a CSV file based on the options selected. It +helps to address issues like variable number of columns, +leading/trailing spaces in columns, and non-UTF-8 encoding issues.
+By default input is expected from standard in and output is sent to standard out (errors to standard error). These can be modified by appropriate options. The csv file is processed as a stream of rows so -minimal memory is used to operate on the file. -
--Normalizing a spread sheet’s column count to 5 padding columns as needed -per row. -
+Normalizing a spread sheet’s column count to 5 padding columns as +needed per row.
cat mysheet.csv | csvcleaner -field-per-row=5
--Trim leading spaces from output. -
+Trim leading spaces from output.
cat mysheet.csv | csvcleaner -left-trim
--Trim trailing spaces from output. -
+Trim trailing spaces from output.
cat mysheet.csv | csvcleaner -right-trim
--Trim leading and trailing spaces from output. -
+Trim leading and trailing spaces from output.
cat mysheet.csv | csvcleaner -trim-space
--csvcleaner 1.2.2 -
+csvcleaner 1.2.2
-csvcols -
--csvcols OPTIONS [ARGS_AS_COL_VALUES] -
--csvcols converts a set of command line args into columns output in CSV -format. -
--It can also be used CSV input rows and rendering only the column numbers -listed on the commandline (first column is 1 not 0). -
-csvcols
+csvcols OPTIONS [ARGS_AS_COL_VALUES]
+csvcols converts a set of command line args into columns output in +CSV format.
+It can also be used CSV input rows and rendering only the column +numbers listed on the commandline (first column is 1 not 0).
+-Simple usage of building a CSV file one row at a time. -
+Simple usage of building a CSV file one row at a time.
csvcols one two three > 3col.csv
csvcols 1 2 3 >> 3col.csv
cat 3col.csv
--Example parsing a pipe delimited string into a CSV line -
+Example parsing a pipe delimited string into a CSV line
csvcols -d "|" "one|two|three" > 3col.csv
csvcols -delimiter "|" "1|2|3" >> 3col.csv
cat 3col.csv
--Using a pipe filter a 3 column CSV for columns 1 and 3 into 2col.csv -
+Using a pipe filter a 3 column CSV for columns 1 and 3 into +2col.csv
cat 3col.csv | csvcols -col 1,3 > 2col.csv
--Using options filter a 3 column CSV file for columns 1,3 into 2col.csv -
+Using options filter a 3 column CSV file for columns 1,3 into +2col.csv
csvcols -i 3col.csv -col 1,3 -o 2col.csv
--csvcols 1.2.2 -
+csvcols 1.2.2
-csvfind -
--csvfind OPTIONS TEXT_TO_MATCH -
--csvfind processes a CSV file as input returning rows that contain the +
csvfind
+csvfind OPTIONS TEXT_TO_MATCH
+csvfind processes a CSV file as input returning rows that contain the column with matched text. Columns are counted from one instead of zero. -Supports exact match as well as some Levenshtein matching. -
--Find the rows where the third column matches “The Red Book of Westmarch” -exactly -
+Find the rows where the third column matches “The Red Book of +Westmarch” exactly
csvfind -i books.csv -col=2 "The Red Book of Westmarch"
--Find the rows where the third column (colums numbered 1,2,3) matches -approximately “The Red Book of Westmarch” -
+Find the rows where the third column (colums numbered 1,2,3) matches +approximately “The Red Book of Westmarch”
csvfind -i books.csv -col=2 -levenshtein \
-insert-cost=1 -delete-cost=1 -substitute-cost=3 \
-max-edit-distance=50 -append-edit-distance \
"The Red Book of Westmarch"
--In this example we’ve appended the edit distance to see how close the -matches are. -
--You can also search for phrases in columns. -
+In this example we’ve appended the edit distance to see how close the +matches are.
+You can also search for phrases in columns.
csvfind -i books.csv -col=2 -contains "Red Book"
--csvfind 1.2.2 -
+csvfind 1.2.2
-csvjoin -
--csvjoin OPTIONS CSV1 CSV2 COL1 COL2 -
--csvjoin outputs CSV content based on two CSV files with matching column -values. Each CSV input file has a designated column to match on. The -values are compared as strings. Columns are counted from one rather than -zero. -
-csvjoin
+csvjoin OPTIONS CSV1 CSV2 COL1 COL2
+csvjoin outputs CSV content based on two CSV files with matching +column values. Each CSV input file has a designated column to match on. +The values are compared as strings. Columns are counted from one rather +than zero.
+-Simple usage of building a merged CSV file from data1.csv and data2.csv -where column 1 in data1.csv matches the value in column 3 of data2.csv -with the results being written to merged-data.csv.. -
+Simple usage of building a merged CSV file from data1.csv and +data2.csv where column 1 in data1.csv matches the value in column 3 of +data2.csv with the results being written to merged-data.csv..
csvjoin -csv1=data1.csv -col1=2 \
-csv2=data2.csv -col2=4 \
-output=merged-data.csv
--csvjoin 1.2.2 -
+csvjoin 1.2.2
-csvrows -
--csvrows OPTIONS [ARGS_AS_ROW_VALUES] -
--csvrows converts a set of command line args into rows of CSV formated +
csvrows
+csvrows OPTIONS [ARGS_AS_ROW_VALUES]
+csvrows converts a set of command line args into rows of CSV formated output. It can also be used to filter or list specific rows of CSV input The first row is 1 not 0. Often row 1 is the header row and csvrows -makes it easy to output only the data rows. -
--Simple usage of building a CSV file one rows at a time. -
+Simple usage of building a CSV file one rows at a time.
csvrows "First,Second,Third" "one,two,three" > 4rows.csv
csvrows "ein,zwei,drei" "1,2,3" >> 4rows.csv
cat 4row.csv
--Example parsing a pipe delimited string into a CSV line -
+Example parsing a pipe delimited string into a CSV line
csvrows -d "|" "First,Second,Third|one,two,three" > 4rows.csv
csvrows -delimiter "|" "ein,zwei,drei|1,2,3" >> 4rows.csv
cat 4rows.csv
--Filter a 10 row CSV file for rows 1,4,6 (top most row is one) -
+Filter a 10 row CSV file for rows 1,4,6 (top most row is one)
cat 10row.csv | csvrows -row 1,4,6 > 3rows.csv
--Filter a 10 row CSV file for rows 1,4,6 from file named “10row.csv” -
+Filter a 10 row CSV file for rows 1,4,6 from file named +“10row.csv”
csvrows -i 10row.csv -row 1,4,6 > 3rows.csv
--Filter 3 randomly selected rows from 10row.csv rendering new CSV with a -header row from 10row.csv. -
+Filter 3 randomly selected rows from 10row.csv rendering new CSV with +a header row from 10row.csv.
csvrows -i 10row.csv -header=true -random=3
--csvrows 1.2.2 -
+csvrows 1.2.2
-finddir -
--finddir OPTIONS [TARGET] [DIRECTORIES_TO_SEARCH] -
--finddir finds directory based on matching prefix, suffix o contained -text in base filename. -
-finddir
+finddir OPTIONS [TARGET] +[DIRECTORIES_TO_SEARCH]
+finddir finds directory based on matching prefix, suffix o contained +text in base filename.
+-Find all subdirectories starting with “img”. -
+Find all subdirectories starting with “img”.
finddir -p img
--finddir 1.2.2 -
+finddir 1.2.2
-findfile -
--findfile OPTIONS [TARGET] [DIRECTORIES_TO_SEARCH] -
--findfile finds files based on matching prefix, suffix or contained text -in base filename. -
-findfile
+findfile OPTIONS [TARGET] +[DIRECTORIES_TO_SEARCH]
+findfile finds files based on matching prefix, suffix or contained +text in base filename.
+-Search the current directory and subdirectories for Markdown files with -extension of “.md”. -
+Search the current directory and subdirectories for Markdown files +with extension of “.md”.
findfile -s .md
--findfile 1.2.2 -
+findfile 1.2.2
-Given the following text in a file named t.txt. -
+Given the following text in a file named t.txt.
one
two
three
-
-How to you get [“one”,“two”,“three”]
using the string
-command?
-
-On approach that might need like it’d work would be to use the +
How to you get ["one","two","three"]
using the string
+command?
On approach that might need like it’d work would be to use the join action word with the string command. But that wouldn’t given you what you want. You actually want to “split” the text -file on the new line character. -
+file on the new line character. string -i t.txt split "\n"
-Convert data1.csv to data1.json using command line options and Unix -pipes. The result will be an array of JSON objects. -
+Convert data1.csv to data1.json using command line options and Unix +pipes. The result will be an array of JSON objects.
csv2json -i data1.csv -o data1.json
cat data1.csv | csv2json > data1.json
--Convert data1.csv to JSON blobs, one line per blob. -
+Convert data1.csv to JSON blobs, one line per blob.
csv2json -as-blobs -i data1.csv
cat data1.csv | csv2json -as-blobs
+-Convert data1.csv to data1.md using Unix pipes. -
+Convert data1.csv to data1.md using Unix pipes.
cat data1.csv | csv2mdtable > data1.md
--Convert data1.csv to data1.md using options. -
+Convert data1.csv to data1.md using options.
csv2mdtable -i data1.csv -o data1.md
+Converting a csv to a workbook.
+ csv2xlsx -i data1.csv MyWorkbook.xlsx 'My worksheet 1'
+This creates a new ‘My worksheet 1’ in the Excel Workbook called +‘MyWorkbook.xlsx’ with the contents of data.csv.
+ cat data1.csv | csv2xlsx MyWorkbook.xlsx 'My worksheet 2'
+This does the same but the contents of data.csv are piped into the +workbook’s ‘My worksheet 2’ sheet.
+-Converting a csv to a workbook. -
- csv2xlsx -i data.csv MyWorkbook.xlsx 'My worksheet 1'
--This creates a new ‘My worksheet 1’ in the Excel Workbook called -‘MyWorkbook.xlsx’ with the contents of data.csv. -
- cat data.csv | csv2xlsx MyWorkbook.xlsx 'My worksheet 2'
--This does the same but the contents of data.csv are piped into the -workbook’s ‘My worksheet 2’ sheet. -
--Normalizing the a spread sheet’s column count to 2 per row. -
+Normalizing the a spread sheet’s column count to 2 per row.
cat mysheet.csv | csvcleaner -field-per-row=2 > 2cols.csv
--Normalizing a spread sheet’s column count to 3 (add a padding column as -needed per row). -
+Normalizing a spread sheet’s column count to 3 (add a padding column +as needed per row).
cat mysheet.csv | csvcleaner -field-per-row=3 > 3cols.csv
--Trim leading spaces. -
+Trim leading spaces.
cat mysheet.csv | csvcleaner -left-trim-spaces > ltrim.csv
--Trim trailing spaces. -
+Trim trailing spaces.
cat mysheet.csv | csvcleaner -right-trim-spaces > rtrim.csv
--Trim leading and trailing spaces -
+Trim leading and trailing spaces
cat mysheet.csv | csvcleaner -trim-spaces > trim.csv
+Simple usage of building a CSV file one row at a time.
+ csvcols one two three > 3col-2.csv
+ csvcols 1 2 3 >> 3col-2.csv
+ cat 3col-2.csv
+Example parsing a pipe delimited string into a CSV line.
+ csvcols -d "|" "one|two|three" > 3col-2.csv
+ csvcols -delimiter "|" "1|2|3" >> 3col-2.csv
+ cat 3col-2.csv
+Using a pipe filter a 3 column CSV for columns 1 and 3 into +2col-2.csv.
+ cat 3col-2.csv | csvcols -col 1,3 > 2col-2.csv
+Using options filter a 3 column CSV file for columns 1,3 into +2col-2.csv.
+ csvcols -i 3col-2.csv -col 1,3 -o 2col-2.csv
+Sometimes CSV files have sloppy or problematic quoting. Two options
+are provided (-use-lazy-quotes, -trim-leading-space). In the example
+below the CSV has trailing white space in the second row. By using
+-use-lazy-quotes
option we can get the first two columns
+without running into CSV parsing errors.
csvcols -i quoting-example.csv -use-lazy-quotes -col 1,2
+Input (with trailing whitespace in row 2)
+ "A","B","C@caltech.edu","2017-03-27 14:38:57","Yes","CCE","refund of my deposit"
+ "C","D","E@caltech.edu","2017-04-05 10:50:42","Yes","EAS","receive a refund of my deposit"
+Output
+ A,B
+ C,D
+-Simple usage of building a CSV file one row at a time. -
- csvcols one two three > 3col.csv
- csvcols 1 2 3 >> 3col.csv
- cat 3col.csv
--Example parsing a pipe delimited string into a CSV line. -
- csvcols -d "|" "one|two|three" > 3col.csv
- csvcols -delimiter "|" "1|2|3" >> 3col.csv
- cat 3col.csv
--Using a pipe filter a 3 column CSV for columns 1 and 3 into 2col.csv. -
- cat 3col.csv | csvcols -col 1,3 > 2col.csv
--Using options filter a 3 column CSV file for columns 1,3 into 2col.csv. -
- csvcols -i 3col.csv -col 1,3 -o 2col.csv
-
-Sometimes CSV files have sloppy or problematic quoting. Two options are
-provided (-use-lazy-quotes, -trim-leading-space). In the example below
-the CSV has trailing white space in the second row. By using
--use-lazy-quotes
option we can get the first two columns
-without running into CSV parsing errors.
-
csvcols -i quoting-example.csv -use-lazy-quotes -col 1,2
--Input (with trailing whitespace in row 2) -
- "A","B","C@caltech.edu","2017-03-27 14:38:57","Yes","CCE","refund of my deposit"
- "C","D","E@caltech.edu","2017-04-05 10:50:42","Yes","EAS","receive a refund of my deposit"
--Output -
- A,B
- C,D
--Find the rows where the third column matches “The Red Book of Westmarch” -exactly -
+Find the rows where the third column matches “The Red Book of +Westmarch” exactly
csvfind -i books.csv -o result1.csv -col=2 "The Red Book of Westmarch"
--Find the rows where the third column (colums numbered 0,1,2) matches -approximately “The Red Book of Westmarch” -
+Find the rows where the third column (colums numbered 0,1,2) matches +approximately “The Red Book of Westmarch”
csvfind -i books.csv -o result2.csv -col=2 -levenshtein \
-insert-cost=1 -delete-cost=1 -substitute-cost=3 \
-max-edit-distance=50 -append-edit-distance \
"The Red Book of Westmarch"
--In this example we’ve appended the edit distance to see how close the -matches are. -
--You can also search for phrases in columns. -
+In this example we’ve appended the edit distance to see how close the +matches are.
+You can also search for phrases in columns.
csvfind -i books.csv -o result3.csv -col=2 -contains "Red Book"
+Simple usage of building a merged CSV file from data1-2.csv and +data2-2.csv where column 1 in data1.csv matches the value in column 3 of +data2-2.csv with the results being written to merged-data-2.csv.
+ csvjoin -csv1=data1-2.csv -col1=2 \
+ -csv2=data2-2.csv -col2=4 \
+ -output=merged-data-2.csv
+-Simple usage of building a merged CSV file from data1.csv and data2.csv -where column 1 in data1.csv matches the value in column 3 of data2.csv -with the results being written to merged-data.csv. -
- csvjoin -csv1=data1.csv -col1=2 \
- -csv2=data2.csv -col2=4 \
- -output=merged-data.csv
--Simple usage of building a CSV file one rows at a time. -
+Simple usage of building a CSV file one rows at a time.
csvrows -o 4rows.csv "First,Second,Third" "one,two,three"
csvrows "ein,zwei,drei" "1,2,3" >> 4rows.csv
cat 4row.csv
--Example parsing a pipe delimited string into a CSV line -
+Example parsing a pipe delimited string into a CSV line
csvrows -d "|" "First,Second,Third|one,two,three" > 4rows.csv
csvrows -delimiter "|" "ein,zwei,drei|1,2,3" >> 4rows.csv
cat 4rows.csv
--Filter rows 1 and 3 from CSV file -
- cat 4row.csv | csvrows -row 1,3 > result1.csv
--Filter rows 1 and 3 from CSV file from file named “4row.csv” -
- csvrows -i 4row.csv -row 1,3 > result2.csv
+Filter rows 1 and 3 from CSV file
+ cat 4row.csv | csvrows -row 1,3 > result1-2.csv
+Filter rows 1 and 3 from CSV file from file named “4row.csv”
+ csvrows -i 4row.csv -row 1,3 > result2-2.csv
+-Number - | --Value - | +Number | +Value |
---|---|---|---|
-one - | --1 - | +one | +1 |
-two - | --2 - | +two | +2 |
-three - | --3 - | +three | +3 |
-Searching for duplicate values in a column can be done using +
Searching for duplicate values in a column can be done using cat, csvcols, sort and csvfind. -Here’s the basic algorithm from the command line or Bash script. -
+Here’s the basic algorithm from the command line or Bash script.-Here’s an example Bash script looking for duplicates in +
Here’s an example Bash script looking for duplicates in dups.csv in column 2, second column (columns are counted from 1 -rather than zero) -
+rather than zero) CSV_FILE="dups.csv"
CSV_COL_NO="2"
@@ -80,14 +48,13 @@
csvfind -i "$CSV_FILE" -trim-spaces -col "$CSV_COL_NO" "${CELL}"
fi
done
--This would result a new CSV file with duplicates grouped together. -
+This would result a new CSV file with duplicates grouped +together.
-Find all the subdirectories starting with “doc”. -
+Find all the subdirectories starting with “doc”.
finddir -p doc .
+Find all the subdirectories starting with “doc”.
+ findfile -p doc .
+-If myblob.json contained -
-{"name": "Doe, Jane", "email":"jane.doe@example.org", "age": 42}
--Getting just the name could be done with -
+If myblob.json contained
+{"name": "Doe, Jane", "email":"jane.doe@example.org", "age": 42}
Getting just the name could be done with
jsoncols -i myblob.json .name
--This would yield -
+This would yield
"Doe, Jane"
--Flipping .name and .age into pipe delimited columns is as easy as -listing each field in the expression inside a space delimited string. -
+Flipping .name and .age into pipe delimited columns is as easy as +listing each field in the expression inside a space delimited +string.
jsoncols -i myblob.json -d\| .name .age
--This would yield -
+This would yield
"Doe, Jane"|42
--You can also pipe JSON data in. -
+You can also pipe JSON data in.
cat myblob.json | jsoncols .name .email .age
--Would yield -
+Would yield
"Doe, Jane","jane.doe@xample.org",42
+-Consider two JSON objects one in person.json and another in -profile.json. -
--person.json contains -
+Consider two JSON objects one in person.json and another in +profile.json.
+person.json contains
{ "name": "Doe, Jane", "email":"jd@example.org", "age": 42 }
--profile.json contains -
-profile.json contains +--{ "name": "Doe, Jane", "bio": "World renowned geophysist.", - "email": "jane.doe@example.edu" }
-A simple join of person.json with profile.json (note the -create option) -
+"email": "jane.doe@example.edu" }
A simple join of person.json with profile.json (note the -create +option)
jsonjoin -create person.json profile.json
--would yield and object like -
-would yield and object like +--{ "person": { "name": "Doe, Jane", "email":"jd@example.org", "age": 42}, "profile": { "name": "Doe, Jane", "bio": "World renowned geophysist.", "email": "jane.doe@example.edu" } - }
-Likewise if you want to treat person.json as the root object and add -profile.json as a branch try -
+}
Likewise if you want to treat person.json as the root object and add +profile.json as a branch try
cat person.json | jsonjoin profile.json
--or -
+or
jsonjoin -i person.json profile.json
--this yields an object like -
-this yields an object like +--{ "name": "Doe, Jane", "email":"jd@example.org", "age": 42, "profile": { "name": "Doe, Jane", "bio": "World renowned geophysist.", "email": "jane.doe@example.edu" } - }
-You can modify this behavor with -update or -overwrite. Both options are -order dependant (i.e. not associative, A update B does not necessarily -equal B update A). -
+}
You can modify this behavor with -update or -overwrite. Both options +are order dependant (i.e. not associative, A update B does not +necessarily equal B update A).
-Running -
+Running
jsonjoin -create -update person.json profile.json
--would yield -
-would yield +--{ "name": "Doe, Jane", "email":"jd@example.org", "age": 42, - "bio": "World renowned geophysist." }
-Running -
+"bio": "World renowned geophysist." }
Running
jsonjoin -create -update profile.json person.json
--would yield -
-would yield +--{ "name": "Doe, Jane", "age": 42, "bio": "World renowned geophysist.", - "email": "jane.doe@example.edu" }
-Running -
+"email": "jane.doe@example.edu" }
Running
jsonjoin -create -overwrite person.json profile.json
--would yield -
-would yield ++"bio": "World renowned geophysist." }-{ "name": "Doe, Jane", "email":"jane.doe@example.edu", "age": 42, - "bio": "World renowned geophysist." }
-If person.json contained -
-{"name": "Doe, Jane", "email":"jd@example.org", "age": 42}
--and the template, name.tmpl, contained -
+If person.json contained
+{"name": "Doe, Jane", "email":"jd@example.org", "age": 42}
and the template, name.tmpl, contained
{{- .name -}}
--Getting just the name could be done with -
+Getting just the name could be done with
cat person.json | jsonmunge name.tmpl
--This would yield -
+This would yield
"Doe, Jane"
+-Working with a map -
+Working with a map
echo '{"name": "Doe, Jane", "email":"jane.doe@example.org", "age": 42}' \
| jsonrange
--This would yield -
+This would yield
name
email
age
--Using the -values option on a map -
+Using the -values option on a map
echo '{"name": "Doe, Jane", "email":"jane.doe@example.org", "age": 42}' \
| jsonrange -values
--This would yield -
+This would yield
"Doe, Jane"
"jane.doe@example.org"
42
--Working with an array -
+Working with an array
echo '["one", 2, {"label":"three","value":3}]' | jsonrange
--would yield -
+would yield
0
1
2
--Using the -values option on the same array -
+Using the -values option on the same array
echo '["one", 2, {"label":"three","value":3}]' | jsonrange -values
--would yield -
+would yield
one
2
{"label":"three","value":3}
--Checking the length of a map or array or number of keys in map -
+Checking the length of a map or array or number of keys in map
echo '["one","two","three"]' | jsonrange -length
--would yield -
+would yield
3
--Check for the index value of last element -
+Check for the index value of last element
echo '["one","two","three"]' | jsonrange -last
--would yield -
+would yield
2
--Limitting the number of items returned -
+Limitting the number of items returned
echo '[1,2,3,4,5]' | jsonrange -limit 2
--would yield -
+would yield
1
2
-Find all the subdirectories starting with “doc”. -
- finddir -p doc .
+${body}
-Create a range of integers one through five -
+Create a range of integers one through five
range 1 5
--Yields 1 2 3 4 5 -
--Create a range of integer negative two to six -
+Yields 1 2 3 4 5
+Create a range of integer negative two to six
range -- -2 6
--Yields -2 -1 0 1 2 3 4 5 6 -
--Create a range of even integers two to ten -
+Yields -2 -1 0 1 2 3 4 5 6
+Create a range of even integers two to ten
range -increment=2 2 10
--Yields 2 4 6 8 10 -
--Create a descending range of integers ten down to one -
+Yields 2 4 6 8 10
+Create a descending range of integers ten down to one
range 10 1
--Yields 10 9 8 7 6 5 4 3 2 1 -
--Pick a random integer between zero and ten -
+Yields 10 9 8 7 6 5 4 3 2 1
+Pick a random integer between zero and ten
range -r 0 10
--Yields a random integer from 0 to 10 -
+Yields a random integer from 0 to 10
+If today was 2014-08-03 and you wanted the date three days in the +past try–
+ reldate 3 days
+The output would be
+ 2014-08-06
+Supported time units are
+Specifying a date to calucate from
+reldate handles dates in the YYYY-MM-DD format (e.g. March 1, 2014 +would be 2014-03-01). By default reldate uses today as the date to +calculate relative time from. If you use the –from option you can it +will calculate the relative date from that specific date.
+ reldate --from=2014-08-03 3 days
+Will yield
+ 2014-08-06
+Command line arguments traditionally start with a dash which we also +use to denote a nagative number. To tell the command line process that +to not treat negative numbers as an “option” precede your time increment +and time unit with a double dash.
+ reldate --from=2014-08-03 -- -3 days
+Will yield
+ 2014-07-31
+You can calculate a date from a weekday name (e.g. Saturday, Monday, +Tuesday) knowning a day (e.g. 2015-02-10 or the current date of the +week) occurring in a week. A common case would be wanting to figure out +the Monday date of a week containing 2015-02-10. The week is presumed to +start on Sunday (i.e. 0) and finish with Saturday (e.g. 6).
+ reldate --from=2015-02-10 Monday
+will yield
+ 2015-02-09
+As that is the Monday of the week containing 2015-02-10. Weekday +names case insensitive and can be the first three letters of the English +names or full English names (e.g. Monday, monday, Mon, mon).
+-If today was 2014-08-03 and you wanted the date three days in the past -try– -
- reldate 3 days
--The output would be -
- 2014-08-06
--Supported time units are -
--Specifying a date to calucate from -
--reldate handles dates in the YYYY-MM-DD format (e.g. March 1, 2014 would -be 2014-03-01). By default reldate uses today as the date to calculate -relative time from. If you use the –from option you can it will -calculate the relative date from that specific date. -
- reldate --from=2014-08-03 3 days
--Will yield -
- 2014-08-06
--Command line arguments traditionally start with a dash which we also use -to denote a nagative number. To tell the command line process that to -not treat negative numbers as an “option” precede your time increment -and time unit with a double dash. -
- reldate --from=2014-08-03 -- -3 days
--Will yield -
- 2014-07-31
--You can calculate a date from a weekday name (e.g. Saturday, Monday, -Tuesday) knowning a day (e.g. 2015-02-10 or the current date of the -week) occurring in a week. A common case would be wanting to figure out -the Monday date of a week containing 2015-02-10. The week is presumed to -start on Sunday (i.e. 0) and finish with Saturday (e.g. 6). -
- reldate --from=2015-02-10 Monday
--will yield -
- 2015-02-09
--As that is the Monday of the week containing 2015-02-10. Weekday names -case insensitive and can be the first three letters of the English names -or full English names (e.g. Monday, monday, Mon, mon). -
--The examples below are each borken down in two parts. The first part +
The examples below are each borken down in two parts. The first part shows a short version of the commands you might use in practice. This is followed by a step by step implementation to take some of the mystery -out of the short version. -
--How to easily convert a name in “FAMILY, GIVEN” form to “GIVEN FAMILY” -form? -
--Traditionally this can be done using a number of Unix commands such as -echo and cut. If you break down the task into getting -each name separately it is pretty easy using a couple shell variables. -
+out of the short version. +How to easily convert a name in “FAMILY, GIVEN” form to “GIVEN +FAMILY” form?
+Traditionally this can be done using a number of Unix commands such +as echo and cut. If you break down the task into +getting each name separately it is pretty easy using a couple shell +variables.
NAME="Doiel, Robert"
GIVEN_FAMILY="$(echo -n "$NAME" | cut -d , -f 1) $(echo -n "$NAME" | cut -d , -f 2)"
echo "$FAMILY $GIVEN"
--This uses the subshell syntax and two separate pipe lines. Let’s break -it down by parts. -
+This uses the subshell syntax and two separate pipe lines. Let’s +break it down by parts.
NAME="Doiel, Robert"
echo "Step 1: [$NAME]"
FAMILY_NAME=$(echo -n "$NAME" | cut -d , -f 1)
echo "Step 2: [$FAMILY_NAME]
GIVEN_NAME=$(echo -n "$NAME" | cut -d , -f 2)
echo "Step 3: [$GIVEN_NAME $FAMILY_NAME]"
--Each pipeline builds up a name (family and given) and the final -echo displays them. -
--NOTE: The trouble is this doesn’t give you what you want. Notice the +
Each pipeline builds up a name (family and given) and the final +echo displays them.
+NOTE: The trouble is this doesn’t give you what you want. Notice the leading space. You can fix that but that is just the start of the rabbit -whole. -
--If we think about the family name and given name as elements of an array -we can easily reorder them. In this approach we’ll use two commands. The -string and jsoncols commands from datatools. -
+whole. +If we think about the family name and given name as elements of an +array we can easily reorder them. In this approach we’ll use two +commands. The string and jsoncols commands from +datatools.
NAME="Doiel, Robert"
string split ", " "$NAME" | jsoncols -i - -d ' ' '.[0]' '.[1]'
--First difference you’ll notice is we’re using an Unix pipe to send the -output of one command to another. While you can eventually do that in -the traditional approach it becomes very complicated very quickly. Using -datatools it is easy to move from strings to JSON and back. -
--Let’s take the datatools approach and output the results of -each step rather than using a pipeline. -
+First difference you’ll notice is we’re using an Unix pipe to send +the output of one command to another. While you can eventually do that +in the traditional approach it becomes very complicated very quickly. +Using datatools it is easy to move from strings to JSON and +back.
+Let’s take the datatools approach and output the results of +each step rather than using a pipeline.
NAME="Doiel, Robert"
echo "Step 1: [$NAME]"
JSON_ARRAY=$(string split ", " "$NAME")
echo "Step 2: $JSON_ARRAY"
GIVEN_FAMILY=$(jsoncols -d ' ' '.[0]' '.[1]' "$JSON_ARRAY")
echo "Step 3: [$GIVEN_FAMILY]"
--NOTE: In this version there is no leading space issue. string -command can split on multiple characters and in our case it is splitting -on comma space not just on the comma like we get with cut. -
+NOTE: In this version there is no leading space issue. +string command can split on multiple characters and in our case +it is splitting on comma space not just on the comma like we get with +cut.
-Given the a CSV file called data.csv you select a sampling of -rows with the command csvrows using a few options. In this +
Given the a CSV file called data.csv you select a sampling +of rows with the command csvrows using a few options. In this example we will assume data.csv has a header row we want to preserve and that our resulting sample will be called -sample.csv. The options we use are -
+sample.csv. The options we use are-i
selecting data.csv as the input source
--o
sends the resulting CSV to the file named
-sample.csv
--header=true
indicates the header should be preserved and
-not be counted as part of the sample
--random
sets the number or rows to return in the sample, in
-this case twenty
--i
selecting data.csv as the input source-o
sends the resulting CSV to the file named
+sample.csv-header=true
indicates the header should be preserved
+and not be counted as part of the sample-random
sets the number or rows to return in the
+sample, in this case twenty-Putting it all together– -
+Putting it all together–
csvrows -i data.csv -o sample.csv -header=true -random=20
--NOTE: If data.csv has less than 20 rows then +
NOTE: If data.csv has less than 20 rows then sample.csv will include all the rows of data.csv in a -shuffled order. -
--csvrows reads in the entire csv file into memory, shuffles the -row using Go’s rand package to calculate the rows to swap and then write -out the number of rows request in the shuffled order. The randomness is -limitted by the shuffle and the write of the first N shuffled rows. -
+shuffled order. +csvrows reads in the entire csv file into memory, shuffles +the row using Go’s rand package to calculate the rows to swap and then +write out the number of rows request in the shuffled order. The +randomness is limitted by the shuffle and the write of the first N +shuffled rows.
-Format the date July, 7, 2016 in YYYY-MM-DD format -
+Format the date July, 7, 2016 in YYYY-MM-DD format
timefmt -input "2006-01-02" -output "01/02/2006" "2016-07-02"
--Yields “07/02/2016” -
--Format the MySQL date/time of 8:08am, July 2, 2016 -
+Yields “07/02/2016”
+Format the MySQL date/time of 8:08am, July 2, 2016
timefmt -input mysql -output RFC822 "2016-07-02 08:08:08"
--Yields “02 Jul 16 08:08 UTC” -
+Yields “02 Jul 16 08:08 UTC”
+-Given the following text in a file name t.txt where the last -line contains a trailing newline. -
+Given the following text in a file name t.txt where the last +line contains a trailing newline.
one
two
three
--Running split to create an JSON array yields an extra empty -string. -
+Running split to create an JSON array yields an extra empty +string.
string -i t.txt split '\n'
--Yields -
-["one","two","three",""]
--To avoid the trailing empty string in the array you can -trimspace first then do your split on newlines. -
+Yields
+["one","two","three",""]
To avoid the trailing empty string in the array you can +trimspace first then do your split on newlines.
string -i t.txt trimspace | split -i - '\n'
--Yields -
-["one","two","three"]
-Yields
+["one","two","three"]
-With no options returns “http.commy/page.html” -
+With no options returns “http.commy/page.html”
urlparse http://example.com/my/page.html
--Get protocol. Returns “http”. -
+Get protocol. Returns “http”.
urlparse -protocol http://example.com/my/page.html
--Get host or domain name. Returns “example.com”. -
+Get host or domain name. Returns “example.com”.
urlparse -host http://example.com/my/page.html
--Get path. Returns “/my/page.html”. -
+Get path. Returns “/my/page.html”.
urlparse -path http://example.com/my/page.html
--Get dirname. Returns “my” -
+Get dirname. Returns “my”
urlparse -dirname http://example.com/my/page.html
--Get basename. Returns “page.html”. -
+Get basename. Returns “page.html”.
urlparse -basename http://example.com/my/page.html
--Get extension. Returns “.html”. -
+Get extension. Returns “.html”.
urlparse -extname http://example.com/my/page.html
--Without options urlparse returns protocol, host and path fields -separated by a tab. -
+Without options urlparse returns protocol, host and path fields +separated by a tab.
+-Extract a workbook sheet as a CSV file -
+Extract a workbook sheet as a CSV file
xlsx2csv my-workbook.xlsx "Sheet 1" > sheet1.csv
--This would get the first sheet from the workbook and save it as a CSV -file. -
+This would get the first sheet from the workbook and save it as a CSV +file.
xlsx2csv -count my-workbook.xlsx
--This will output the number of sheets in the Workbook. -
+This will output the number of sheets in the Workbook.
xlsx2csv -sheets my-workbook.xlsx
--This will display a list of sheet names, one per line. Putting it all -together in a shell script. -
+This will display a list of sheet names, one per line. Putting it all +together in a shell script.
for SHEET_NAME in $(xlsx2csv -n my-workbook.xlsx); do
xlsx2csv my-workbook.xlsx "$SHEET_NAME" > \
"${SHEET_NAME// /-}.csv"
done
+-This would get the sheet named “Sheet 1” from “my-workbook.xlsx” and -save as sheet1.json -
+This would get the sheet named “Sheet 1” from “my-workbook.xlsx” and +save as sheet1.json
xlsx2json my-workbook.xlsx "Sheet 1" > sheet1.json
--This would get the number of sheets in the workbook -
+This would get the number of sheets in the workbook
xlsx2json -count my-workbook.xlsx
--This will output the title of the sheets in the workbook -
+This will output the title of the sheets in the workbook
xlsx2json -sheets my-workbook.xlsx
--Putting it all together in a shell script and convert all sheets to into -JSON documents.. -
+Putting it all together in a shell script and convert all sheets to +into JSON documents..
xlsx2json -n my-workbook.xlsx | while read SHEET_NAME; do
xlsx2json my-workbook.xlsx "$SHEET_NAME" > \
"${SHEET_NAME// /-}.json"
done
+-datatools provides a variety of command line programs for -working with data in different formats as well as to ease Posix shell -scripting (e.g. writing scripts that run under Bash). The tools are -group as data, strings and scripting. -
--Command line utilities for simplifying work with CSV, JSON, TOML, YAML, -Excel Workbooks and plain text files or content. -
+datatools is a rich collection of command line programs +targetting data conversion, cleanup and analysis directly from your +favorite POSIX shell. It has proven useful for data collaberations where +individual members of a project may prefer different toolsets in their +analysis (e.g. Julia, R, Python) but want to work from a common +baseline. It also has been used intensively for internal reporting from +various Caltech Library metadata sources.
+The tools fall into three broad categories
-Compiled versions are provided for Linux (amd64), Mac OS X (amd64), -Windows 10 (amd64) and Raspbian (ARM7). See -https://github.com/caltechlibrary/datatools/releases. -
-
-Use “-help” option for a full list of options for each utility
-(e.g. csv2json -help
).
-
-datatools provides the string +
See user manual for a complete list of +the command line programs. The data transformation tools include support +for formats such as Excel XML, csv, tab delimited files, json, yaml and +toml.
+Compiled versions of the datatools collection are provided for Linux +(amd64), Mac OS X (amd64), Windows 10 (amd64) and Raspbian (ARM7). See +https://github.com/caltechlibrary/datatools/releases.
+Use “-help” option for a full list of options for each utility
+(e.g. csv2json -help
).
The tooling around transformation includes data conversion. These +include tools that work with CSV, tab delimited, JSON, TOML, YAML and +Excel XML.
+There is also tooling to change data shapes using JSON as the +intermediate data format.
+Various utilities for simplifying work on the command line.
+datatools provides the string command for working with text strings (limited to memory available). This is commonly needed when cleanup data for analysis. The string command was created for when the old Unix standbys- @@ -172,94 +82,27 @@
string [OPTIONS] [ACTION] [ARCTION_PARAMETERS…]
-
+command is
+string [OPTIONS] [ACTION] [ARCTION_PARAMETERS...]
string toupper "one two three"
--Would yield “ONE TWO THREE”. -
--Some of the features included -
--See string for full details -
--Various utilities for simplifying work on the command line. -
+Would yield “ONE TWO THREE”.
+Some of the features included
-Compiled versions are provided for Linux (amd64), Mac OS X (amd64), -Windows 10 (amd64) and Raspbian (ARM7). See -https://github.com/caltechlibrary/datatools/releases. -
--Use the utilities try “-help” option for a full list of options. -
--See INSTALL.md for details for installing -pre-compiled versions of the programs. -
+See string for full details
+See INSTALL.md for details for installing +pre-compiled versions of the programs.
-datatools is a collection of command line programs run from a -shell like Bash. -
--This is generalized instructions for a release. -
--Compiled versions are available for Mac OS X (amd64 and M1 processor, +
datatools is a collection of command line programs run from +a shell like Bash.
+This is generalized instructions for a release.
+Compiled versions are available for Mac OS X (amd64 and M1 processor, macos-amd64 and macos-arm64), Linux (amd64 process, linux-amd64), Windows (amd64 and arm64 processor, windows-amd64 and windows-arm64) and -Rapsberry Pi (arm7 processor, raspbian-arm7) -
--VERSION_NUMBER is a symantic version -number (e.g. v0.1.2) -
--For all the released version go to the project page on Github and click -latest release -
+Rapsberry Pi (arm7 processor, raspbian-arm7) +VERSION_NUMBER is a symantic version +number (e.g. v0.1.2)
+For all the released version go to the project page on Github and +click latest release
--https://github.com/caltechlibrary/datatools/releases/latest -
+https://github.com/caltechlibrary/datatools/releases/latest
-Platform - | --Zip Filename - | +Platform | +Zip Filename |
---|---|---|---|
-Windows - | --datatools-VERSION_NUMBER-windows-amd64.zip - | +Windows | +datatools-VERSION_NUMBER-windows-amd64.zip |
-Windows - | --datatools-VERSION_NUMBER-windows-arm64.zip - | +Windows | +datatools-VERSION_NUMBER-windows-arm64.zip |
-Mac OS X - | --datatools-VERSION_NUMBER-macos-amd64.zip - | +Mac OS X | +datatools-VERSION_NUMBER-macos-amd64.zip |
-Mac OS X - | --datatools-VERSION_NUMBER-macos-arm64.zip - | +Mac OS X | +datatools-VERSION_NUMBER-macos-arm64.zip |
-Linux/Intel - | --datatools-VERSION_NUMBER-linux-amd64.zip - | +Linux/Intel | +datatools-VERSION_NUMBER-linux-amd64.zip |
-Raspbery Pi OS - | --datatools-VERSION_NUMBER-raspberry_pi_os-arm7.zip - | +Raspbery Pi OS | +datatools-VERSION_NUMBER-raspberry_pi_os-arm7.zip |
-Here’s an example of the commands run in the Terminal App after -downloading the zip file. -
-Here’s an example of the commands run in the Terminal App after +downloading the zip file.
+ cd Downloads/
unzip datatools-*-macos-amd64.zip
mkdir -p $HOME/bin
mv -v bin/* $HOME/bin/
export PATH=$HOME/bin:$PATH
csvfind -version
- cd Downloads/
unzip datatools-*-macos-arm64.zip
mkdir -p $HOME/bin
mv -v bin/* $HOME/bin/
export PATH=$HOME/bin:$PATH
csvfind -version
--(Assumes you’re working from Bash as provided by Linux Subsystem for -Windows) -
+(Assumes you’re working from Bash as provided by Linux Subsystem for +Windows)
-Here’s an example of the commands run in from the Bash shell on Windows -10 after downloading the zip file. -
-Here’s an example of the commands run in from the Bash shell on +Windows 10 after downloading the zip file.
+ cd Downloads/
unzip datatools-*-windows-amd64.zip
mkdir -p $HOME/bin
mv -v bin/* $HOME/bin/
export PATH=$HOME/bin:$PATH
csvfind -version
- cd Downloads/
unzip datatools-*-windows-arm64.zip
mkdir -p $HOME/bin
mv -v bin/* $HOME/bin/
export PATH=$HOME/bin:$PATH
csvfind -version
--Here’s an example of the commands run in from the Bash shell after -downloading the zip file. -
+Here’s an example of the commands run in from the Bash shell after +downloading the zip file.
cd Downloads/
unzip datatools-*-linux-amd64.zip
mkdir -p $HOME/bin
cp -v bin/* $HOME/bin/
export PATH=$HOME/bin:$PATH
csvfind -version
--Released version is for a Raspberry Pi 2 or later use (i.e. requires ARM -7 support). -
+Released version is for a Raspberry Pi 2 or later use (i.e. requires +ARM 7 support).
-Here’s an example of the commands run in from the Bash shell after -downloading the zip file. -
+Here’s an example of the commands run in from the Bash shell after +downloading the zip file.
cd Downloads/
unzip datatools-*-raspberry_pi_os-arm7.zip
mkdir -p $HOME/bin
cp -v bin/* $HOME/bin/
export PATH=$HOME/bin:$PATH
csvfind -version
-
-datatools is “go gettable” if you have previously gotten xlsx
-v1.0.5 package from Compiling from source
+ datatools is “go gettable” if you have previously gotten
+xlsx v1.0.5 package from github.com/tealeg/xlsx. The
datatools package does not support versions v2.x and greater of xlsx.
Below are the steps I use today with “go get” command to download the
-dependant packages as well as datatools’s source code.
-
-Setting up the right version of xlsx for datatools
-
Setting up the right version of xlsx for datatools
cd
go get github.com/tealeg/xlsx
cd src/github.com/tealeg
git checkout v1.0.5
cd
-
-Using go get
to install datatools using v1.0.5 of xlsx.
-
Using go get
to install datatools using v1.0.5 of
+xlsx.
go get github.com/caltechlibrary/datatools/...
--Or clone the repository and then compile -
+Or clone the repository and then compile
cd
git clone https://github.com/caltechlibrary/datatools src/github.com/caltechlibrary/datatools
cd src/github.com/caltechlibrary/datatools
@@ -355,7 +203,7 @@
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/json2toml.1.html b/json2toml.1.html
index 9485002..d2fdb89 100644
--- a/json2toml.1.html
+++ b/json2toml.1.html
@@ -11,121 +11,68 @@
-
-NAME
-
-
-json2toml
-
-
-SYNOPSIS
-
-
-json2toml OPTIONS [JSON_FILENAME] [TOML_FILENAME]
-
-
-DESCRIPTION
-
-
-json2toml is a tool that converts JSON objects into TOML output.
-
-
-OPTIONS
-
+NAME
+json2toml
+SYNOPSIS
+json2toml OPTIONS [JSON_FILENAME]
+[TOML_FILENAME]
+DESCRIPTION
+json2toml is a tool that converts JSON objects into TOML output.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
-
--version: display version
-
+-version: display version
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--p, -pretty
-
+- -p, -pretty
-
pretty print output
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-These would get the file named “my.json” and save it as my.toml
-
+EXAMPLES
+These would get the file named “my.json” and save it as my.toml
json2toml my.json > my.toml
json2toml my.json my.toml
cat my.json | json2toml -i - > my.toml
-
-json2toml 1.2.2
-
+json2toml 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/json2yaml.1.html b/json2yaml.1.html
index 0076f94..416b562 100644
--- a/json2yaml.1.html
+++ b/json2yaml.1.html
@@ -11,116 +11,65 @@
-
-NAME
-
-
-json2yaml
-
-
-SYNOPSIS
-
-
-json2yaml OPTIONS [JSON_FILENAME] [YAML_FILENAME]
-
-
-DESCRIPTION
-
-
-json2yaml is a tool that converts JSON objects into YAML output.
-
-
-OPTIONS
-
+NAME
+json2yaml
+SYNOPSIS
+json2yaml OPTIONS [JSON_FILENAME]
+[YAML_FILENAME]
+DESCRIPTION
+json2yaml is a tool that converts JSON objects into YAML output.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-These would get the file named “my.json” and save it as my.yaml
-
+EXAMPLES
+These would get the file named “my.json” and save it as my.yaml
json2yaml my.json > my.yaml
json2yaml my.json my.taml
cat my.json | json2yaml -i - > my.taml
-
-json2yaml 1.2.2
-
+json2yaml 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/jsoncols.1.html b/jsoncols.1.html
index 7c5726b..91bc433 100644
--- a/jsoncols.1.html
+++ b/jsoncols.1.html
@@ -11,200 +11,116 @@
-
-NAME
-
-
-jsoncols
-
-
-SYNOPSIS
-
-
-jsoncols OPTIONS [EXPRESSION] [INPUT_FILENAME]
-[OUTPUT_FILENAME]
-
-
-DESCRIPTION
-
-
-jsoncols provides scripting flexibility for data extraction from JSON
+
NAME
+jsoncols
+SYNOPSIS
+jsoncols OPTIONS [EXPRESSION] [INPUT_FILENAME]
+[OUTPUT_FILENAME]
+DESCRIPTION
+jsoncols provides scripting flexibility for data extraction from JSON
data returning the results in columns. This is helpful in flattening
content extracted from JSON blobs. The default delimiter for each value
-extracted is a comma. This can be overridden with an option.
-
+extracted is a comma. This can be overridden with an option.
--
-EXPRESSION can be an empty string or dot notation for an object’s path
-
--
-INPUT_FILENAME is the filename to read or a dash “-” if you want to
+
- EXPRESSION can be an empty string or dot notation for an object’s
+path
+- INPUT_FILENAME is the filename to read or a dash “-” if you want to
explicitly read from stdin
--
-if not provided then jsoncols reads from stdin
-
-
-
--
-OUTPUT_FILENAME is the filename to write or a dash “-” if you want to
-explicitly write to stdout
+
- if not provided then jsoncols reads from stdin
+
+OUTPUT_FILENAME is the filename to write or a dash “-” if you want
+to explicitly write to stdout
--
-if not provided then jsoncols write to stdout
-
-
-
+if not provided then jsoncols write to stdout
+
-
-OPTIONS
-
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--csv
-
+- -csv
-
output as CSV or other flat delimiter row
--
--d, -delimiter
-
+- -d, -delimiter
-
set the delimiter for multi-field csv output
--
--i, -input
-
+- -i, -input
-
input filename
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--p, -pretty
-
+- -p, -pretty
-
pretty print JSON output
--
--quiet
-
+- -quiet
-
suppress error messages
--
--quote
-
+- -quote
-
quote strings and JSON notation
--
--r, -repl
-
+- -r, -repl
-
run interactively
-
-EXAMPLES
-
-
-If myblob.json contained
-
+EXAMPLES
+If myblob.json contained
{"name": "Doe, Jane", "email":"jane.doe@example.org", "age": 42}
-
-Getting just the name could be done with
-
+Getting just the name could be done with
jsoncols -i myblob.json .name
-
-This would yield
-
+This would yield
"Doe, Jane"
-
-Flipping .name and .age into pipe delimited columns is as easy as
-listing each field in the expression inside a space delimited string.
-
+Flipping .name and .age into pipe delimited columns is as easy as
+listing each field in the expression inside a space delimited
+string.
jsoncols -i myblob.json -d\| .name .age
-
-This would yield
-
+This would yield
Doe, Jane|42
-
-You can also pipe JSON data in.
-
+You can also pipe JSON data in.
cat myblob.json | jsoncols .name .email .age
-
-Would yield
-
+Would yield
"Doe, Jane","jane.doe@xample.org",42
-
-jsoncols 1.2.2
-
+jsoncols 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/jsonjoin.1.html b/jsonjoin.1.html
index 211fec1..ce4b4ae 100644
--- a/jsonjoin.1.html
+++ b/jsonjoin.1.html
@@ -11,121 +11,68 @@
-
-NAME
-
-
-json2toml
-
-
-SYNOPSIS
-
-
-json2toml OPTIONS [JSON_FILENAME] [TOML_FILENAME]
-
-
-DESCRIPTION
-
-
-json2toml is a tool that converts JSON objects into TOML output.
-
-
-OPTIONS
-
+NAME
+json2toml
+SYNOPSIS
+json2toml OPTIONS [JSON_FILENAME]
+[TOML_FILENAME]
+DESCRIPTION
+json2toml is a tool that converts JSON objects into TOML output.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
-
--version: display version
-
+-version: display version
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--p, -pretty
-
+- -p, -pretty
-
pretty print output
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-These would get the file named “my.json” and save it as my.toml
-
+EXAMPLES
+These would get the file named “my.json” and save it as my.toml
json2toml my.json > my.toml
json2toml my.json my.toml
cat my.json | json2toml -i - > my.toml
-
-json2toml 1.2.1
-
+json2toml 1.2.1
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/jsonmunge.1.html b/jsonmunge.1.html
index 68e4a6c..8cfeacd 100644
--- a/jsonmunge.1.html
+++ b/jsonmunge.1.html
@@ -11,145 +11,81 @@
-
-NAME
-
-
-jsonmunge
-
-
-SYNOPSIS
-
-
-jsonmunge OPTIONS TEMPLATE_FILENAME
-
-
-DESCRIPTION
-
-
-jsonmunge is a command line tool that takes a JSON document and one or
-more Go templates rendering the results. Useful for reshaping a JSON
+
NAME
+jsonmunge
+SYNOPSIS
+jsonmunge OPTIONS TEMPLATE_FILENAME
+DESCRIPTION
+jsonmunge is a command line tool that takes a JSON document and one
+or more Go templates rendering the results. Useful for reshaping a JSON
document, transforming into a new format, or filter for specific
-content.
-
+content.
--
-TEMPLATE_FILENAME is the name of a Go text tempate file used to render
-the outbound JSON document
-
+- TEMPLATE_FILENAME is the name of a Go text tempate file used to
+render the outbound JSON document
-
-OPTIONS
-
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--E, -expression
-
+- -E, -expression
-
use template expression as template
--
--i, -input
-
+- -i, -input
-
input filename
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-If person.json contained
-
+EXAMPLES
+If person.json contained
{"name": "Doe, Jane", "email":"jd@example.org", "age": 42}
-
-and the template, name.tmpl, contained
-
+and the template, name.tmpl, contained
{{- .name -}}
-
-Getting just the name could be done with
-
+Getting just the name could be done with
cat person.json | jsonmunge name.tmpl
-
-This would yield
-
+This would yield
"Doe, Jane"
-
-jsonmunge 1.2.2
-
+jsonmunge 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/jsonrange.1.html b/jsonrange.1.html
index 98234d8..8c4cc15 100644
--- a/jsonrange.1.html
+++ b/jsonrange.1.html
@@ -11,274 +11,160 @@
-
-NAME
-
-
-jsonrange
-
-
-SYNOPSIS
-
-
-jsonrange OPTIONS [DOT_PATH_EXPRESSION]
-
-
-DESCRIPTION
-
-
-jsonrange returns returns a range of values based on the JSON structure
-being read and options applied. Without options the JSON structure is
-read from standard input and writes a list of keys to standard out. Keys
-are either attribute names or for arrays the index position (counting
-form zero). If a DOT_PATH_EXPRESSION is included on the command line
-then that is used to generate the results. Using options to can choose
-to read the JSON data structure from a file, write the output to a file
-as well as display values instead of keys. a list of “keys” of an index
-or map in JSON.
-
-
-Using options it can also return a list of values. The JSON object is
+
NAME
+jsonrange
+SYNOPSIS
+jsonrange OPTIONS [DOT_PATH_EXPRESSION]
+DESCRIPTION
+jsonrange returns returns a range of values based on the JSON
+structure being read and options applied. Without options the JSON
+structure is read from standard input and writes a list of keys to
+standard out. Keys are either attribute names or for arrays the index
+position (counting form zero). If a DOT_PATH_EXPRESSION is included on
+the command line then that is used to generate the results. Using
+options to can choose to read the JSON data structure from a file, write
+the output to a file as well as display values instead of keys. a list
+of “keys” of an index or map in JSON.
+Using options it can also return a list of values. The JSON object is
read from standard in and the resulting list is normally written to
standard out. There are options to read or write to files. Additional
parameters are assumed to be a dot path notation select the parts of the
-JSON data structure you want from the range.
-
-
-DOT_PATH_EXPRESSION is a dot path stale expression indicating what you
-want range over. E.g.
-
+JSON data structure you want from the range.
+DOT_PATH_EXPRESSION is a dot path stale expression indicating what
+you want range over. E.g.
--
-. would indicate the whole JSON data structure read is used to range
-over
-
--
-.name would indicate to range over the value pointed at by the “name”
-attribute
-
--
-[“name”] would indicate to range over the value pointed at by the “name”
-attribute
-
--
-[0] would indicate to range over the value held in the zero-th element
-of the array
-
+- . would indicate the whole JSON data structure read is used to range
+over
+- .name would indicate to range over the value pointed at by the
+“name” attribute
+- [“name”] would indicate to range over the value pointed at by the
+“name” attribute
+- [0] would indicate to range over the value held in the zero-th
+element of the array
-
-The path can be chained together
-
+The path can be chained together
--
-.name.family would point to the value heald by the “name” attributes’
-“family” attribute.
-
+- .name.family would point to the value heald by the “name”
+attributes’ “family” attribute.
-
-OPTIONS
-
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--d, -delimiter
-
+- -d, -delimiter
-
set delimiter for range output
--
--i, -input
-
+- -i, -input
-
read JSON from file
--
--last
-
+- -last
-
return the index of the last element in list (e.g. length - 1)
--
--length
-
+- -length
-
return the number of keys or values
--
--limit
-
+- -limit
-
limit the number of items output
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
write to output file
--
--quiet
-
+- -quiet
-
suppress error messages
--
--values
-
+- -values
-
return the values instead of the keys
-
-EXAMPLES
-
-
-Working with a map
-
+EXAMPLES
+Working with a map
echo '{"name": "Doe, Jane", "email":"jane.doe@example.org", "age": 42}' \
| jsonrange
-
-This would yield
-
+This would yield
name
email
age
-
-Using the -values option on a map
-
+Using the -values option on a map
echo '{"name": "Doe, Jane", "email":"jane.doe@example.org", "age": 42}' \
| jsonrange -values
-
-This would yield
-
+This would yield
"Doe, Jane"
"jane.doe@example.org"
42
-
-Working with an array
-
+Working with an array
echo '["one", 2, {"label":"three","value":3}]' | jsonrange
-
-would yield
-
+would yield
0
1
2
-
-Using the -values option on the same array
-
+Using the -values option on the same array
echo '["one", 2, {"label":"three","value":3}]' | jsonrange -values
-
-would yield
-
+would yield
one
2
{"label":"three","value":3}
-
-Checking the length of a map or array or number of keys in map
-
+Checking the length of a map or array or number of keys in map
echo '["one","two","three"]' | jsonrange -length
-
-would yield
-
+would yield
3
-
-Check for the index of last element
-
+Check for the index of last element
echo '["one","two","three"]' | jsonrange -last
-
-would yield
-
+would yield
2
-
-Check for the index value of last element
-
+Check for the index value of last element
echo '["one","two","three"]' | jsonrange -values -last
-
-would yield
-
+would yield
"three"
-
-Limitting the number of items returned
-
+Limitting the number of items returned
echo '[10,20,30,40,50]' | %!s(MISSING) -limit 2
-
-would yield
-
+would yield
1
2
-
-Limitting the number of values returned
-
+Limitting the number of values returned
echo '[10,20,30,40,50]' | %!s(MISSING) -values -limit 2
-
-would yield
-
+would yield
10
20
-
-jsonrange 1.2.2
-
+jsonrange 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/license.html b/license.html
deleted file mode 100644
index 0c7b60a..0000000
--- a/license.html
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
-
- Caltech Library's Digital Library Development Sandbox
-
-
-
-
-
-
-
-
-
-
-
-Copyright (c) 2023, Caltech All rights not granted herein are expressly
-reserved by Caltech.
-
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-
--
-
-Redistributions of source code must retain the above copyright notice,
-this list of conditions and the following disclaimer.
-
-
--
-
-Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-
--
-
-Neither the name of the copyright holder nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-
-
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS
-IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
-TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-
-Caltech
-© 2021 Caltech library
-1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
-Phone: (626)395-3405
-Email Us
-Site Map
-
-
-
diff --git a/mergepath.1.html b/mergepath.1.html
index a202466..2a110cf 100644
--- a/mergepath.1.html
+++ b/mergepath.1.html
@@ -11,139 +11,80 @@
-
-NAME
-
-
-mergepath
-
-
-SYNOPSIS
-
-
-mergepath OPTIONS NEW_PATH_PARTS
-
-
-DESCRIPTION
-
-
-mergepath can merge the new path parts with the existing path with
+
NAME
+mergepath
+SYNOPSIS
+mergepath OPTIONS NEW_PATH_PARTS
+DESCRIPTION
+mergepath can merge the new path parts with the existing path with
creating duplications. It can also re-order existing path elements by
prefixing or appending to the existing path and removing the resulting
-duplicate.
-
-
-OPTIONS
-
+duplicate.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--a, -append
-
+- -a, -append
-
Append the directory to the path removing any duplication
--
--c, -clip
-
+- -c, -clip
-
Remove a directory from the path
--
--d, -directory
-
+- -d, -directory
-
The directory you want to add to the path.
--
--e, -envpath
-
+- -e, -envpath
-
The path you want to merge with.
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--p, -prepend
-
+- -p, -prepend
-
Prepend the directory to the path removing any duplication
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-This would put your home bin directory at the beginning of your path.
-
+EXAMPLES
+This would put your home bin directory at the beginning of your
+path.
export PATH=$(mergepath -p $HOME/bin)
-
-mergepath 1.2.2
-
+mergepath 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/mk-website.bash b/mk-website.bash
deleted file mode 100755
index c384f17..0000000
--- a/mk-website.bash
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/bash
-
-function cleanUpHTML() {
- findfile -s ".html" . | while read P; do
- rm "$P"
- done
-}
-
-function FindNavMD() {
- DNAME="$1"
- if [ -f "${DNAME}/nav.md" ]; then
- echo "${DNAME}/nav.md"
- return
- fi
- DNAME=$(dirname "${DNAME}")
- FindNavMD "${DNAME}"
-}
-
-# Cleanup stale HTML files
-cleanUpHTML
-
-# Look through files and build new site
-mkpage "nav=nav.md" "content=markdown:$(cat LICENSE)" page.tmpl > license.html
-findfile -s ".md" . | while read P; do
- DNAME=$(dirname "$P")
- FNAME=$(basename "$P")
- case "$FNAME" in
- "INSTALL.md")
- HTML_NAME="${DNAME}/install.html"
- ;;
- "README.md")
- if [ ! -f "${DNAME}/index.md" ]; then
- HTML_NAME="${DNAME}/index.html"
- else
- HTML_NAME="${DNAME}/README.html"
- fi
- ;;
- *)
- HTML_NAME=$(echo "$P" | sed -E 's/.md$/.html/g')
- ;;
- esac
- if [ "${DNAME:0:4}" != "dist" ] && [ "${FNAME}" != "nav.md" ]; then
- NAV=$(FindNavMD "$DNAME")
- echo "Building $HTML_NAME from $DNAME/$FNAME and $NAV"
- mkpage "nav=$NAV" "content=${DNAME}/${FNAME}" page.tmpl >"${HTML_NAME}"
- git add "${HTML_NAME}"
- else
- echo "Skipping $P"
- fi
-done
-
-
diff --git a/nav.md b/nav.md
deleted file mode 100644
index 81db216..0000000
--- a/nav.md
+++ /dev/null
@@ -1,9 +0,0 @@
-+ [Home](/)
-+ [README](index.html)
-+ [LICENSE](license.html)
-+ [INSTALL](install.html)
-+ [Documentation](docs/)
-+ [How To](how-to/)
-+ [User Manual](user-manual.html)
-+ [About](about.html)
-+ [Github](https://github.com/caltechlibrary/datatools)
diff --git a/nav.tmpl b/nav.tmpl
deleted file mode 100644
index 307cb4e..0000000
--- a/nav.tmpl
+++ /dev/null
@@ -1,9 +0,0 @@
-+ [Home](/)
-${if(readme)}+ [README](${if(relroot)}${relroot}${endif}${readme})${endif}
-${if(license)}+ [LICENSE](${if(relroot)}${relroot}${endif}${license})${endif}
-${if(install)}+ [INSTALL](${if(relroot)}${relroot}${endif}${install})${endif}
-${if(docs)}+ [Documentation](${if(relroot)}${relroot}${endif}${docs})${endif}
-${if(howto)}+ [How To](${if(relroot)}${relroot}${endif}${howto})${endif}
-${if(usermanual)}+ [User Manual](${if(relroot)}${relroot}${endif}${usermanual})${endif}
-${if(about)}+ [About](${if(relroot)}${relroot}${endif}${about})${endif}
-${if(gitrepo)}+ [Github](${gitrepo})${endif}
diff --git a/page.tmpl b/page.tmpl
index 191dee8..77a6fcd 100644
--- a/page.tmpl
+++ b/page.tmpl
@@ -10,16 +10,25 @@
-${content}
+${body}
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/range.1.html b/range.1.html
index 025c374..0b285d0 100644
--- a/range.1.html
+++ b/range.1.html
@@ -11,169 +11,91 @@
-
-NAME
-
-
-range
-
-
-SYNOPSIS
-
-
-range OPTIONS START_INTEGER END_INTEGER
-[INCREMENT_INTEGER]
-
-
-DESCRIPTION
-
-
-range is a simple utility for shell scripts that emits a list of
+
NAME
+range
+SYNOPSIS
+range OPTIONS START_INTEGER END_INTEGER
+[INCREMENT_INTEGER]
+DESCRIPTION
+range is a simple utility for shell scripts that emits a list of
integers starting with the first command line argument and ending with
the last integer command line argument. It is a subset of functionality
-found in the Unix seq command.
-
-
-If the first argument is greater than the last then it counts down
-otherwise it counts up.
-
-
-OPTIONS
-
+found in the Unix seq command.
+If the first argument is greater than the last then it counts down
+otherwise it counts up.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--e, -end
-
+- -e, -end
-
The ending integer.
--
--inc, -increment
-
+- -inc, -increment
-
The non-zero integer increment value.
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--quiet
-
+- -quiet
-
suppress error messages
--
--random
-
+- -random
-
Pick a range value from range
--
--s, -start
-
+- -s, -start
-
The starting integer.
-
-EXAMPLES
-
-
-Create a range of integers one through five
-
+EXAMPLES
+Create a range of integers one through five
range 1 5
-
-Yields 1 2 3 4 5
-
-
-Create a range of integer negative two to six
-
+Yields 1 2 3 4 5
+Create a range of integer negative two to six
range -- -2 6
-
-Yields -2 -1 0 1 2 3 4 5 6
-
-
-Create a range of even integers two to ten
-
+Yields -2 -1 0 1 2 3 4 5 6
+Create a range of even integers two to ten
range -increment=2 2 10
-
-Yields 2 4 6 8 10
-
-
-Create a descending range of integers ten down to one
-
+Yields 2 4 6 8 10
+Create a descending range of integers ten down to one
range 10 1
-
-Yields 10 9 8 7 6 5 4 3 2 1
-
-
-Pick a random integer between zero and ten
-
+Yields 10 9 8 7 6 5 4 3 2 1
+Pick a random integer between zero and ten
range -random 0 10
-
-Yields a random integer from 0 to 10
-
-
-range 1.2.1
-
+Yields a random integer from 0 to 10
+range 1.2.1
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/reldate.1.html b/reldate.1.html
index 56cd8d4..ad6b85e 100644
--- a/reldate.1.html
+++ b/reldate.1.html
@@ -11,199 +11,111 @@
-
-NAME
-
-
-reldate
-
-
-SYNOPSIS
-
-
-reldate OPTIONS [TIME_DESCRPTION]
-
-
-DESCRIPTION
-
-
-reldate is a small command line utility which returns the relative date
-in YYYY-MM-DD format. This is helpful when scripting various time
+
NAME
+reldate
+SYNOPSIS
+reldate OPTIONS [TIME_DESCRPTION]
+DESCRIPTION
+reldate is a small command line utility which returns the relative
+date in YYYY-MM-DD format. This is helpful when scripting various time
relationships. The difference in time returned are determined by the
-time increments provided.
-
-
-Time increments are a positive or negative integer. Time unit can be
+time increments provided.
+Time increments are a positive or negative integer. Time unit can be
either day(s), week(s), month(s), or year(s). Weekday names are case
insentive (e.g. Monday and monday). They can be abbreviated to the first
three letters of the name, e.g. Sunday can be Sun, Monday can be Mon,
Tuesday can be Tue, Wednesday can be Wed, Thursday can be Thu, Friday
-can be Fri or Saturday can be Sat.
-
-
-OPTIONS
-
+can be Fri or Saturday can be Sat.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--e, -end-of-month
-
+- -e, -end-of-month
-
Display the end of month day. E.g. 2012-02-29
--
--f, -from
-
+- -f, -from
-
Date the relative time is calculated from.
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-If today was 2014-08-03 and you wanted the date three days in the past
-try–
-
+EXAMPLES
+If today was 2014-08-03 and you wanted the date three days in the
+past try–
reldate 3 days
-
-The output would be
-
+The output would be
2014-08-06
-
-TIME UNITS
-
-
-Supported time units are
-
+TIME UNITS
+Supported time units are
--
-day(s)
-
--
-week(s)
-
--
-year(s)
-
+- day(s)
+- week(s)
+- year(s)
-
-Specifying a date to calucate from
-
-
-reldate handles dates in the YYYY-MM-DD format (e.g. March 1, 2014 would
-be 2014-03-01). By default reldate uses today as the date to calculate
-relative time from. If you use the –from option you can it will
-calculate the relative date from that specific date.
-
+Specifying a date to calucate from
+reldate handles dates in the YYYY-MM-DD format (e.g. March 1, 2014
+would be 2014-03-01). By default reldate uses today as the date to
+calculate relative time from. If you use the –from option you can it
+will calculate the relative date from that specific date.
reldate --from=2014-08-03 3 days
-
-Will yield
-
+Will yield
2014-08-06
-
-NEGATIVE INCREMENTS
-
-
-Command line arguments traditionally start with a dash which we also use
-to denote a nagative number. To tell the command line process that to
-not treat negative numbers as an “option” precede your time increment
-and time unit with a double dash.
-
+NEGATIVE INCREMENTS
+Command line arguments traditionally start with a dash which we also
+use to denote a nagative number. To tell the command line process that
+to not treat negative numbers as an “option” precede your time increment
+and time unit with a double dash.
reldate --from=2014-08-03 -- -3 days
-
-Will yield
-
+Will yield
2014-07-31
-
-RELATIVE WEEK DAYS
-
-
-You can calculate a date from a weekday name (e.g. Saturday, Monday,
+
RELATIVE WEEK DAYS
+You can calculate a date from a weekday name (e.g. Saturday, Monday,
Tuesday) knowning a day (e.g. 2015-02-10 or the current date of the
week) occurring in a week. A common case would be wanting to figure out
the Monday date of a week containing 2015-02-10. The week is presumed to
-start on Sunday (i.e. 0) and finish with Saturday (e.g. 6).
-
+start on Sunday (i.e. 0) and finish with Saturday (e.g. 6).
reldate --from=2015-02-10 Monday
-
-will yield
-
+will yield
2015-02-09
-
-As that is the Monday of the week containing 2015-02-10. Weekday names
-case insensitive and can be the first three letters of the English names
-or full English names (e.g. Monday, monday, Mon, mon).
-
-
-reldate 1.2.2
-
+As that is the Monday of the week containing 2015-02-10. Weekday
+names case insensitive and can be the first three letters of the English
+names or full English names (e.g. Monday, monday, Mon, mon).
+reldate 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/reltime.1.html b/reltime.1.html
index 0b0def6..6eb7392 100644
--- a/reltime.1.html
+++ b/reltime.1.html
@@ -11,88 +11,46 @@
-
-NAME
-
-
-reltime
-
-
-SYNOPSIS
-
-
-reltime RELATIVE_TIME_STRING
-
-
-DESCRIPTION
-
-
-reltime provides a relative time string in the “HH:MM:SS” in 24 hour
-format.
-
-
-The notation for the relative time string is based on Go’s time duration
-string. From https://golang.google.cn/pkg/time/#ParseDuration,
-
+NAME
+reltime
+SYNOPSIS
+reltime RELATIVE_TIME_STRING
+DESCRIPTION
+reltime provides a relative time string in the “HH:MM:SS” in 24 hour
+format.
+The notation for the relative time string is based on Go’s time
+duration string. From
+https://golang.google.cn/pkg/time/#ParseDuration,
-
-A duration string is a possibly signed sequence of decimal numbers, each
-with optional fraction and a unit suffix, such as “300ms”, “-1.5h” or
-“2h45m”. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”.
-
+A duration string is a possibly signed sequence of decimal numbers,
+each with optional fraction and a unit suffix, such as “300ms”, “-1.5h”
+or “2h45m”. Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”,
+“h”.
-
-EXAMPLES
-
-
-Get the dime ninety minutes in the past.
-
+EXAMPLES
+Get the dime ninety minutes in the past.
reltime -- -90m
-
-Get the time 24 hours ago
-
+Get the time 24 hours ago
reltime -- -24h
-
-Get the time 16 hours, 23 minutes and 4 seconds in the future.
-
+Get the time 16 hours, 23 minutes and 4 seconds in the future.
reltime 16h23m4s
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/sql2csv.1.html b/sql2csv.1.html
index 236d99f..d86cf6d 100644
--- a/sql2csv.1.html
+++ b/sql2csv.1.html
@@ -11,70 +11,32 @@
-
-NAME
-
-
-sql2csv
-
-
-SYNOPSIS
-
-
-sql2csv OPTIONS SQL_STATEMENT
-
-
-sql2csv OPTIONS CONFIG_FILE SQL_STATEMENT
-
-
-DESCRIPTION
-
-
-sql2csv takes a config file describing a SQL database connection and
+
NAME
+sql2csv
+SYNOPSIS
+sql2csv OPTIONS SQL_STATEMENT
+sql2csv OPTIONS CONFIG_FILE SQL_STATEMENT
+DESCRIPTION
+sql2csv takes a config file describing a SQL database connection and
output options needed and a SQL statement as the final parameter. The
output of the SQL query is rendered in CSV format to standard out.
-sql2csv supports querying MySQL 8, Postgres and SQLite3 databases.
-
-
-The configuration file is a JSON document with the following key value
-pairs.
-
+sql2csv supports querying MySQL 8, Postgres and SQLite3 databases.
+The configuration file is a JSON document with the following key
+value pairs.
--
-dsn_url
-
+- dsn_url
-
(string) A data source name in URL form where the “protocol” element
identifies the database resource being accessed (e.g. “sqlite://”,
@@ -82,131 +44,88 @@
href="https://github.com/golang/go/wiki/SQLInterface"
class="uri">https://github.com/golang/go/wiki/SQLInterface.
--
-header_row
-
+- header_row
-
(boolean) if true print a header row in the output, false for no header
row output
--
-delimiter
-
+- delimiter
-
(single character, default is “,”), sets the field delimited used in
output. It can be set to “ for tab separated values.
--
-use_crlf
-
+- use_crlf
-
(boolean, default is false) if set to true to use “” as the line
terminator between rows of output.
-
-To connect with a database sql2csv relies on a data source name (DSN) in
-URL format. In the URL form the URL’s scheme indicates the type of
+
To connect with a database sql2csv relies on a data source name (DSN)
+in URL format. In the URL form the URL’s scheme indicates the type of
database you are connecting to (e.g. sqlite, mysql, postgres). The rest
-of the DNS has the following form
-
+of the DNS has the following form
[username[:password]@][protocol[(address)]]/dbname[?param1=value1&...¶mN=valueN]
-
-For a simple database like SQLite3 a minimal DSN in url form for a
-database file “my_database.sqlite3” would look like
-
+For a simple database like SQLite3 a minimal DSN in url form for a
+database file “my_database.sqlite3” would look like
sqlite://file:my_database.sqlite3
-
-For MySQL you need to provide more information to connect
+
For MySQL you need to provide more information to connect
(e.g. username, password). In this example the username is “jane.doe”,
password is “something_secret” the database is “my_database”. (this
-example assumes that MySQL 8 is running on localhost at the usual port).
-
+example assumes that MySQL 8 is running on localhost at the usual
+port).
mysql://jane.doe:something_secret@/my_database
-
-Postgres is similar to the MySQL connection string except the “scheme”
-is “postgres” instead of “mysql”.
-
-
-OPTIONS
-
+Postgres is similar to the MySQL connection string except the
+“scheme” is “postgres” instead of “mysql”.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--version
-
+- -version
-
display version
--
--license
-
+- -license
-
display license
-
-A the following options will override a configuration.
-
+A the following options will override a configuration.
--
--dsn
-
+- -dsn
-
use the data source name in URL form instead of a JSON configuration
file
--
--header
-
+- -header
-
use a header row if true, false skip the header row
--
--delimiter
-
+- -delimiter
-
Set the delimiter to use, default is comma
--
--use-cdlf
-
+- -use-cdlf
-
Force the line ending per row to carage return and line feed if true,
false use line feed
-
-EXAMPLE
-
-
-Using the “dbcfg.json” configuration file, display ten rows from table
-“mytable” in database indicated in “dbcfg.json”.
-
-
-sql2csv dbcfg.json ‘SELECT * FROM mytable LIMIT 10’
-
-
-The CSV output is written standard out and can be redirected into a file
-if desired.
-
-
-sql2csv dbcfg.json ‘SELECT * FROM mytable LIMIT 10’
->ten-rows.csv
-
-
-sql2csv 1.2.2
-
+EXAMPLE
+Using the “dbcfg.json” configuration file, display ten rows from
+table “mytable” in database indicated in “dbcfg.json”.
+sql2csv dbcfg.json ‘SELECT * FROM mytable LIMIT 10’
+The CSV output is written standard out and can be redirected into a
+file if desired.
+sql2csv dbcfg.json ‘SELECT * FROM mytable LIMIT 10’
+>ten-rows.csv
+sql2csv 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/string.1.html b/string.1.html
index bfe006b..1b16535 100644
--- a/string.1.html
+++ b/string.1.html
@@ -11,341 +11,211 @@
-
-NAME
-
-
-string
-
-
-SYNOPSIS
-
-
-string OPTIONS [VERB] [VERB PARAMETERS…]
-
-
-DESCRIPTION
-
-
-string is a command line tool for transforming strings in common ways.
-
+NAME
+string
+SYNOPSIS
+string OPTIONS [VERB] [VERB PARAMETERS…]
+DESCRIPTION
+string is a command line tool for transforming strings in common
+ways.
--
-string length
-
--
-changing cases
-
--
-checking for prefixes, suffixes
-
--
-trimming prefixes, suffixes and cutsets (i.e. list of characters to cut)
-
--
-position, counting and replacing substrings
-
--
-splitting a string into a JSON array of strings, joining JSON a string
-arrays into a string
-
+- string length
+- changing cases
+- checking for prefixes, suffixes
+- trimming prefixes, suffixes and cutsets (i.e. list of characters to
+cut)
+- position, counting and replacing substrings
+- splitting a string into a JSON array of strings, joining JSON a
+string arrays into a string
-
-VERB refers to the operation to performed on the supplied string(s). VER
-PARAMETERS are thsose additional terms need to complete the process
-provided by the VERB.
-
-
-OPTIONS
-
-
-Options always come before the VERB.
-
+VERB refers to the operation to performed on the supplied string(s).
+VER PARAMETERS are thsose additional terms need to complete the process
+provided by the VERB.
+OPTIONS
+Options always come before the VERB.
--
--help
-
+- -help
-
display help
-
--license :display license
-
+-license :display license
--
--version
-
+- -version
-
display version
--
--d, -delimiter
-
+- -d, -delimiter
-
set the delimiter
--
--do, -output-delimiter
-
+- -do, -output-delimiter
-
set the output delimiter
--
--i, -input
-
+- -i, -input
-
input file name
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output file name
--
--quiet
-
+- -quiet
-
suppress error messages
-
-VERBS
-
+VERBS
--
-contains
-
+- contains
-
-has substrings: SUBSTRING [STRING]
string contains SUBSTRING
-[STRING]
+has substrings: SUBSTRING [STRING]
+string contains SUBSTRING [STRING]
--
-count
-
+- count
-
-count substrings: SUBSTRING [STRING]
string count SUBSTRING
-[STRING]
+count substrings: SUBSTRING [STRING]
+string count SUBSTRING [STRING]
--
-englishtitle
-
+- englishtitle
-
-English style title case: [STRING]
string englishtitle
-[STRING]
+English style title case: [STRING]
+string englishtitle [STRING]
--
-hasprefix
-
+- hasprefix
-
-true/false on prefix: PREFIX [STRING]
string hasprefix PREFIX
-[STRING]
+true/false on prefix: PREFIX [STRING]
+string hasprefix PREFIX [STRING]
--
-hassuffix
-
+- hassuffix
-
-true/false on suffix: SUFFIX [STRING]
string hassuffix SUFFIX
-[STRING]
+true/false on suffix: SUFFIX [STRING]
+string hassuffix SUFFIX [STRING]
--
-join
-
+- join
-
-join JSON array into string: DELIMITER [JSON_ARRAY]
string join
-DELIMITER [JSON_ARRAY]
+join JSON array into string: DELIMITER [JSON_ARRAY]
+string join DELIMITER [JSON_ARRAY]
--
-length
-
+- length
-
length of string: [STRING]
string length [STRING]
--
-padleft
-
+- padleft
-
-left pad PADDING MAX_LENGTH [STRING]
string padleft PADDING
-MAX_LENGTH [STRING]
+left pad PADDING MAX_LENGTH [STRING]
+string padleft PADDING MAX_LENGTH [STRING]
--
-padright
-
+- padright
-
-right pad PADDING MAX_LENGTH [STRING]
string padright PADDING
-MAX_LENGTH [STRING]
+right pad PADDING MAX_LENGTH [STRING]
+string padright PADDING MAX_LENGTH [STRING]
--
-position
-
+- position
-
-position of substring: SUBSTRING [STRING]
string position
-SUBSTRING [STRING]
+position of substring: SUBSTRING [STRING]
+string position SUBSTRING [STRING]
--
-replace
-
+- replace
-
replace: OLD NEW [STRING]
string replace OLD NEW [STRING]
--
-replacen
-
+- replacen
-
-replace n times: OLD NEW N [STRING]
string replacen OLD NEW N
-[STRING]
+replace n times: OLD NEW N [STRING]
+string replacen OLD NEW N [STRING]
--
-slice
-
+- slice
-
-copy a substring: START END [STRING]
string slice START END
-[STRING]
+copy a substring: START END [STRING]
+string slice START END [STRING]
--
-split
-
+- split
-
-split into a JSON array: DELIMITER [STRING]
string split DELIMITER
-[STRING]
+split into a JSON array: DELIMITER [STRING]
+string split DELIMITER [STRING]
--
-splitn
-
+- splitn
-
-split into an N length JSON array: DELIMITER N [STRING]
string
-splitn DELIMITER N [STRING]
+split into an N length JSON array: DELIMITER N [STRING]
+string splitn DELIMITER N [STRING]
--
-tolower
-
+- tolower
-
to lower case: [STRING]
string tolower [STRING]
--
-totitle
-
+- totitle
-
to title case: [STRING]
string totitle [STRING]
--
-toupper
-
+- toupper
-
to upper case: [STRING]
string toupper [STRING]
--
-trim
-
+- trim
-
-trim (beginning and end), CUTSET [STRING]
string trim CURSET
-[STRING]
+trim (beginning and end), CUTSET [STRING]
+string trim CURSET [STRING]
--
-trimleft
-
+- trimleft
-
left trim CUTSET [STRING]
string trimleft CUTSET [STRING]
--
-trimprefix
-
+- trimprefix
-
-trims prefix: PREFIX [STRING]
string trimprefix PREFIX
-[STRING]
+trims prefix: PREFIX [STRING]
+string trimprefix PREFIX [STRING]
--
-trimright
-
+- trimright
-
-right trim: CUTSET [STRING]
string trimright CUTSET
-[STRING]
+right trim: CUTSET [STRING]
+string trimright CUTSET [STRING]
--
-trimspace
-
+- trimspace
-
-trim leading and trailing spaces: [STRING]
string trimspace
-[STRING]
+trim leading and trailing spaces: [STRING]
+string trimspace [STRING]
--
-trimsuffix
-
+- trimsuffix
-
-trim suffix: SUFFIX [STRING]
string trimsuffix SUFFIX
-[STRING]
+trim suffix: SUFFIX [STRING]
+string trimsuffix SUFFIX [STRING]
-
-EXAMPLES
-
-
-Convert text to upper case
-
+EXAMPLES
+Convert text to upper case
string toupper "one"
-
-Convert text to lower case
-
+Convert text to lower case
string tolower "ONE"
-
-Captialize an English phrase
-
+Captialize an English phrase
string englishtitle "one more thing to know"
-
-Split a space newline delimited list of words into a JSON array
-
+Split a space newline delimited list of words into a JSON array
string -i wordlist.txt split "\n"
-
-Join a JSON array of strings into a newline delimited list
-
+Join a JSON array of strings into a newline delimited list
string join '\n' '["one","two","three","four","five"]'
-
-string 1.2.2
-
+string 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/tab2csv.1.html b/tab2csv.1.html
index fa7ddaf..4106f49 100644
--- a/tab2csv.1.html
+++ b/tab2csv.1.html
@@ -11,132 +11,72 @@
-
-NAME
-
-
-tab2csv
-
-
-SYNOPSIS
-
-
-tab2csv OPTIONS
-
-
-DESCRIPTION
-
-
-tab2csv is a simple conversion utility to convert from tabs to quoted
-CSV.
-
-
-tab2csv reads from standard input and writes to standard out.
-
-
-OPTIONS
-
+NAME
+tab2csv
+SYNOPSIS
+tab2csv OPTIONS
+DESCRIPTION
+tab2csv is a simple conversion utility to convert from tabs to quoted
+CSV.
+tab2csv reads from standard input and writes to standard out.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--fields-per-record
-
+- -fields-per-record
-
(int) sets the number o fields expected in each row, -1 turns this off
--
--reuse-record
-
+- -reuse-record
-
re-uses the backing array on reader
--
--trim-leading-space
-
+- -trim-leading-space
-
trims leading space read
--
--use-lazy-quotes
-
+- -use-lazy-quotes
-
use lazy quoting for reader
-
-EXAMPLES
-
-
-If my.tab contained
-
+EXAMPLES
+If my.tab contained
name email age
Doe, Jane jane.doe@example.org 42
-
-Concert this to a CSV file format
-
+Concert this to a CSV file format
tab2csv < my.tab
-
-This would yield
-
+This would yield
"name","email","age"
"Doe, Jane","jane.doe@example.org",42
-
-tab2csv 1.2.2
-
+tab2csv 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/timefmt.1.html b/timefmt.1.html
index ca8509e..f8230a2 100644
--- a/timefmt.1.html
+++ b/timefmt.1.html
@@ -11,154 +11,84 @@
-
-NAME
-
-
-timefmt
-
-
-SYNOPSIS
-
-
-timefmt OPTIONS TIME_STRING_TO_CONVERT
-
-
-DESCRIPTION
-
-
-timefmt formats the current date or INPUT_DATE based on the output
+
NAME
+timefmt
+SYNOPSIS
+timefmt OPTIONS TIME_STRING_TO_CONVERT
+DESCRIPTION
+timefmt formats the current date or INPUT_DATE based on the output
format provided in options. The default input and output format is
RFC3339. Formats are specified based on Golang’s time package including
-the common constants (e.g. RFC822, RFC1123).
-
-
-For details see https://golang.org/pkg/time/#Time.Format.
-
-
-One additional time layout provided by timefmt
-
+the common constants (e.g. RFC822, RFC1123).
+For details see https://golang.org/pkg/time/#Time.Format.
+One additional time layout provided by timefmt
--
-mysql “2006-01-02 15:04:05 -0700”
-
+- mysql “2006-01-02 15:04:05 -0700”
-
-OPTIONS
-
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--if, -input-format
-
+- -if, -input-format
-
Set format for input
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--of, -output-format
-
+- -of, -output-format
-
Set format for output
--
--quiet
-
+- -quiet
-
suppress error messages
--
--utc
-
+- -utc
-
timestamps in UTC
-
-EXAMPLES
-
-
-Format the date July, 7, 2016 in YYYY-MM-DD format
-
+EXAMPLES
+Format the date July, 7, 2016 in YYYY-MM-DD format
timefmt -if "2006-01-02" -of "01/02/2006" "2017-12-02"
-
-Yields “12/02/2017”
-
-
-Format the MySQL date/time of 8:08am, July 2, 2016
-
+Yields “12/02/2017”
+Format the MySQL date/time of 8:08am, July 2, 2016
timefmt -input-format mysql -output-format RFC822 "2017-12-02 08:08:08"
-
-Yields “02 Dec 17 08:08 UTC”
-
-
-timefmt 1.2.2
-
+Yields “02 Dec 17 08:08 UTC”
+timefmt 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/toml2json.1.html b/toml2json.1.html
index 4eec267..f4de8c5 100644
--- a/toml2json.1.html
+++ b/toml2json.1.html
@@ -11,123 +11,70 @@
-
-NAME
-
-
-toml2json
-
-
-SYNOPSIS
-
-
-toml2json OPTIONS [TOML_FILENAME] [JSON_NAME]
-
-
-DESCRIPTION
-
-
-toml2json is a tool that converts TOML into JSON. It operates on
-standard input and writes to standard output.
-
-
-OPTIONS
-
+NAME
+toml2json
+SYNOPSIS
+toml2json OPTIONS [TOML_FILENAME]
+[JSON_NAME]
+DESCRIPTION
+toml2json is a tool that converts TOML into JSON. It operates on
+standard input and writes to standard output.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--p, -pretty
-
+- -p, -pretty
-
pretty print output
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-These would get the file named “my.toml” and save it as my.json
-
+EXAMPLES
+These would get the file named “my.toml” and save it as my.json
toml2json my.toml > my.json
toml2json my.toml my.json
cat my.toml | toml2json -i - > my.json
-
-toml2json 1.2.2
-
+toml2json 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/urlparse.1.html b/urlparse.1.html
index e0b1bd4..83881bf 100644
--- a/urlparse.1.html
+++ b/urlparse.1.html
@@ -11,189 +11,107 @@
-
-NAME
-
-
-urlparse
-
-
-SYNOPSIS
-
-
-urlparse OPTIONS URL_TO_PARSE
-
-
-DESCRIPTION
-
-
-urlparse can parse a URL and return the specific elements requested
-(e.g. protocol, hostname, path, query string)
-
-
-OPTIONS
-
+NAME
+urlparse
+SYNOPSIS
+urlparse OPTIONS URL_TO_PARSE
+DESCRIPTION
+urlparse can parse a URL and return the specific elements requested
+(e.g. protocol, hostname, path, query string)
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--H, -host
-
+- -H, -host
-
Display the hostname (and port if specified) found in URL.
--
--P, -protocol
-
+- -P, -protocol
-
Display the protocol of URL (defaults to http)
--
--base, -basename
-
+- -base, -basename
-
Display the base filename at the end of the path.
--
--d, -delimiter
-
+- -d, -delimiter
-
Set the output delimited for parsed display. (defaults to tab)
--
--dir, -dirname
-
+- -dir, -dirname
-
Display all but the last element of the path
--
--ext, -extname
-
+- -ext, -extname
-
Display the filename extension (e.g. .html).
--
--i, -input
-
+- -i, -input
-
input filename
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--p, -path
-
+- -p, -path
-
Display the path after the hostname.
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-With no options returns “http.commy/page.html”
-
+EXAMPLES
+With no options returns “http.commy/page.html”
urlparse http://example.com/my/page.html
-
-Get protocol. Returns “http”.
-
+Get protocol. Returns “http”.
urlparse -protocol http://example.com/my/page.html
-
-Get host or domain name. Returns “example.com”.
-
+Get host or domain name. Returns “example.com”.
urlparse -host http://example.com/my/page.html
-
-Get path. Returns “/my/page.html”.
-
+Get path. Returns “/my/page.html”.
urlparse -path http://example.com/my/page.html
-
-Get dirname. Returns “my”
-
+Get dirname. Returns “my”
urlparse -dirname http://example.com/my/page.html
-
-Get basename. Returns “page.html”.
-
+Get basename. Returns “page.html”.
urlparse -basename http://example.com/my/page.html
-
-Get extension. Returns “.html”.
-
+Get extension. Returns “.html”.
urlparse -extname http://example.com/my/page.html
-
-Without options urlparse returns protocol, host and path fields
-separated by a tab.
-
-
-urlparse 1.2.2
-
+Without options urlparse returns protocol, host and path fields
+separated by a tab.
+urlparse 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/user-manual.html b/user-manual.html
index 9a0f7c1..221e92b 100644
--- a/user-manual.html
+++ b/user-manual.html
@@ -11,165 +11,91 @@
-
-Datatools User Manual
-
-
-Below is a collection man manual pages for each of the command line
-tools that comes with the datatools project.
-
+Datatools User Manual
+Below is a collection man manual pages for each of the command line
+tools that comes with the datatools project.
+Data transformation and
+conversion
--
-codemeta2cff, generate a CITATION.cff
-file from a codemeta.json file
-
--
-csv2json, convert CSV into a JSON
-
--
-csv2mdtable, convert CSV into a
-Markdown table (for use with Pandoc)
-
--
-csv2tab, convert CSV to a tab delimited
-file
-
--
-csv2xlsx, convert CSV to Excel XML
-formatted file
-
--
-csvcleaner, cleanup a CSV file and
-normalize it
-
--
-csvcols, extract columns of values from a
-CSV file
-
--
-csvfind, find content in a CSV file
-
--
-csvjoin, join two CSV files into one
-
--
-csvrows, extract rows of values from a CSV
-file
-
--
-finddir, find a directory
-
--
-findfile, find a file (e.g. list for a
-files recursively by file extension)
-
--
-json2toml, convert JSON to TOML
-
--
-json2yaml, convert JSON to YAML
-
--
-jsoncols, extract columns from JSON
-
--
-jsonjoin, join JSON documents
-
--
-jsonmunge, process JSON through a go
-template
-
--
-jsonrange, iterate a JSON expression of a
-list
-
--
-mergepath, manage the PATH environment
-variable (e.g. remove duplication paths, append, insert and cut from
-PATH list)
-
--
-range, emit a range of numbers (can be
-ascending, descending, odd/even, etc)
-
--
-reldate, compute a relative date in
-YYYY-MM-DD format
-
--
-reltime, compute a relative time in
-HH:MM:SS format
-
--
-sql2csv, convert a SQL query into a CSV
-output
-
--
-string, various string manipulation actions,
-append, cut, pad, trim, etc.
-
--
-tab2csv, tab delimited file to CSV
-
--
-timefmt, format a time string
-
--
-toml2json, TAML to JSON
-
--
-urlparse, parse a URL into its components
-(e.g. protocol, hostname, path)
-
--
-xlsx2csv, convert an Excel XML file’s
-“sheet” to csv
-
--
-xlsx2json, convert an Excel XML file’s
-“sheet” into JSON
-
--
-yaml2json, convert YAML into JSON
-
+- codemeta2cff, generate a
+CITATION.cff file from a codemeta.json file
+- csv2json, convert CSV into a JSON
+- csv2mdtable, convert CSV into a
+Markdown table (for use with Pandoc)
+- csv2tab, convert CSV to a tab delimited
+file
+- csv2xlsx, convert CSV to Excel XML
+formatted file
+- csvcleaner, cleanup a CSV file and
+normalize it
+- csvcols, extract columns of values from
+a CSV file
+- csvfind, find content in a CSV
+file
+- csvjoin, join two CSV files into
+one
+- csvrows, extract rows of values from a
+CSV file
+- finddir, find a directory
+- findfile, find a file (e.g. list for a
+files recursively by file extension)
+- json2toml, convert JSON to TOML
+- json2yaml, convert JSON to YAML
+- jsoncols, extract columns from
+JSON
+- jsonjoin, join JSON documents
+- jsonmunge, process JSON through a go
+template
+- jsonrange, iterate a JSON expression
+of a list
+- sql2csv, convert a SQL query into a CSV
+output
+- tab2csv, tab delimited file to CSV
+- toml2json, TAML to JSON
+- xlsx2csv, convert an Excel XML file’s
+“sheet” to csv
+- xlsx2json, convert an Excel XML
+file’s “sheet” into JSON
+- yaml2json, convert YAML into
+JSON
+
+Shell helpers
+
+- mergepath, manage the PATH
+environment variable (e.g. remove duplication paths, append, insert and
+cut from PATH list)
+- range, emit a range of numbers (can be
+ascending, descending, odd/even, etc)
+- reldate, compute a relative date in
+YYYY-MM-DD format
+- reltime, compute a relative time in
+HH:MM:SS format
+- timefmt, format a time string
+- urlparse, parse a URL into its
+components (e.g. protocol, hostname, path)
+
+String manipution
+
+- string, various string manipulation
+actions, append, cut, pad, trim, etc.
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/user-manual.md b/user-manual.md
index b5cae5c..20b0678 100644
--- a/user-manual.md
+++ b/user-manual.md
@@ -9,6 +9,7 @@ pubDate: 2023-01-12
Below is a collection man manual pages for each of the command line tools
that comes with the datatools project.
+## Data transformation and conversion
- [codemeta2cff](codemeta2cff.1.html), generate a CITATION.cff file from a codemeta.json file
- [csv2json](csv2json.1.html), convert CSV into a JSON
@@ -28,18 +29,25 @@ that comes with the datatools project.
- [jsonjoin](jsonjoin.1.html), join JSON documents
- [jsonmunge](jsonmunge.1.html), process JSON through a go template
- [jsonrange](jsonrange.1.html), iterate a JSON expression of a list
-- [mergepath](mergepath.1.html), manage the PATH environment variable (e.g. remove duplication paths, append, insert and cut from PATH list)
-- [range](range.1.html), emit a range of numbers (can be ascending, descending, odd/even, etc)
-- [reldate](reldate.1.html), compute a relative date in YYYY-MM-DD format
-- [reltime](reltime.1.html), compute a relative time in HH:MM:SS format
- [sql2csv](sql2csv.1.html), convert a SQL query into a CSV output
-- [string](string.1.html), various string manipulation actions, append, cut, pad, trim, etc.
- [tab2csv](tab2csv.1.html), tab delimited file to CSV
-- [timefmt](timefmt.1.html), format a time string
- [toml2json](toml2json.1.html), TAML to JSON
-- [urlparse](urlparse.1.html), parse a URL into its components (e.g. protocol, hostname, path)
- [xlsx2csv](xlsx2csv.1.html), convert an Excel XML file's "sheet" to csv
- [xlsx2json](xlsx2json.1.html), convert an Excel XML file's "sheet" into JSON
- [yaml2json](yaml2json.1.html), convert YAML into JSON
+## Shell helpers
+
+- [mergepath](mergepath.1.html), manage the PATH environment variable (e.g. remove duplication paths, append, insert and cut from PATH list)
+- [range](range.1.html), emit a range of numbers (can be ascending, descending, odd/even, etc)
+- [reldate](reldate.1.html), compute a relative date in YYYY-MM-DD format
+- [reltime](reltime.1.html), compute a relative time in HH:MM:SS format
+- [timefmt](timefmt.1.html), format a time string
+- [urlparse](urlparse.1.html), parse a URL into its components (e.g. protocol, hostname, path)
+
+
+## String manipution
+
+- [string](string.1.html), various string manipulation actions, append, cut, pad, trim, etc.
+
diff --git a/version.go b/version.go
deleted file mode 100644
index 5df73e2..0000000
--- a/version.go
+++ /dev/null
@@ -1,22 +0,0 @@
-package datatools
-
-const (
- Version = "1.2.2"
-
-LicenseText = `
-
-Copyright (c) 2023, Caltech
-All rights not granted herein are expressly reserved by Caltech.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-
-3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-`
-)
-
diff --git a/website.mak b/website.mak
index 4ac9827..286d453 100644
--- a/website.mak
+++ b/website.mak
@@ -3,25 +3,27 @@
#
PROJECT = datatools
-PANDOC = $(shell which pandoc)
+MD_PAGES = $(shell ls -1 *.md)
-MD_PAGES = $(shell ls -1 *.md | grep -v 'nav.md')
+HTML_PAGES = $(shell ls -1 *.md | sed -E 's/\.md/.html/g')
-HTML_PAGES = $(shell ls -1 *.md | grep -v 'nav.md' | sed -E 's/.md/.html/g')
+build: about.md $(MD_PAGES) $(HTML_PAGES) how-to
-build: $(HTML_PAGES) $(MD_PAGES) LICENSE.html
+about.md: codemeta.json
+ echo "" | pandoc -metadata title="About $(PROJECT)" -metadata-file=codemeta.json -s --from markdown --to markdown --template=page.tmpl -o about.md
+ git add about.md
$(HTML_PAGES): $(MD_PAGES) .FORCE
- if [ -f $(PANDOC) ]; then $(PANDOC) --metadata title=$(basename $@) -s --to html5 $(basename $@).md -o $(basename $@).html \
- --template=page.tmpl; fi
- @if [ $@ = "README.html" ]; then mv README.html index.html; fi
-
-LICENSE.html: LICENSE
- pandoc --metadata title="$(PROJECT) License" -s --from Markdown --to html5 LICENSE -o license.html \
+ pandoc --metadata title=$(basename $@) -s --to html5 $(basename $@).md -o $(basename $@).html \
--template=page.tmpl
+ -if [ $@ = "README.html" ]; then mv README.html index.html; git add index.html; fi
+ -if [ -f $(basename $@).html ]; then git add $(basename $@).html; fi
+
+how-to:
+ cd how-to && make -f website.mak
clean:
- @if [ -f index.html ]; then rm *.html; fi
- #@if [ -f docs/index.html ]; then rm docs/*.html; fi
+ if ls -1 *.html >/dev/null; then rm *.html; fi
+ if ls -1 how-to/*.html>/dev/null; then rm how-to/*.html; fi
.FORCE:
diff --git a/xlsx2csv.1.html b/xlsx2csv.1.html
index 60de1e6..4af5989 100644
--- a/xlsx2csv.1.html
+++ b/xlsx2csv.1.html
@@ -11,141 +11,81 @@
-
-NAME
-
-
-xlsx2csv
-
-
-SYNOPSIS
-
-
-xlsx2csv OPTIONS EXCEL_WORKBOOK_NAME [SHEET_NAME]
-
-
-DESCRIPTION
-
-
-xlsx2csv is a tool that converts individual Excel Sheets to CSV output.
-
-
-OPTIONS
-
+NAME
+xlsx2csv
+SYNOPSIS
+xlsx2csv OPTIONS EXCEL_WORKBOOK_NAME
+[SHEET_NAME]
+DESCRIPTION
+xlsx2csv is a tool that converts individual Excel Sheets to CSV
+output.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--N, -sheets
-
+- -N, -sheets
-
display the Workbook sheet names
--
--c, -count
-
+- -c, -count
-
display number of Workbook sheets
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-Extract a workbook sheet as a CSV file
-
+EXAMPLES
+Extract a workbook sheet as a CSV file
xlsx2csv MyWorkbook.xlsx "My worksheet 1" > sheet1.csv
-
-This would get the first sheet from the workbook and save it as a CSV
-file.
-
+This would get the first sheet from the workbook and save it as a CSV
+file.
xlsx2csv -count MyWorkbook.xlsx
-
-This will output the number of sheets in the Workbook.
-
+This will output the number of sheets in the Workbook.
xlsx2csv -sheets MyWorkbook.xlsx
-
-This will display a list of sheet names, one per line. Putting it all
-together in a shell script.
-
+This will display a list of sheet names, one per line. Putting it all
+together in a shell script.
xlsx2csv -N MyWorkbook.xlsx | while read SHEET_NAME; do
CSV_NAME="${SHEET_NAME// /-}.csv"
xlsx2csv -o "${CSV_NAME}" MyWorkbook.xlsx "${SHEET_NAME}"
done
-
-xlsx2csv 1.2.2
-
+xlsx2csv 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/xlsx2json.1.html b/xlsx2json.1.html
index 0d2a4e4..d3fbcaa 100644
--- a/xlsx2json.1.html
+++ b/xlsx2json.1.html
@@ -11,143 +11,81 @@
-
-NAME
-
-
-xlsx2json
-
-
-SYNOPSIS
-
-
-xlsx2json OPTIONS EXCEL_WORKBOOK_NAME
-[SHEET_NAME]
-
-
-DESCRIPTION
-
-
-xlsx2json is a tool that converts individual Excel Workbook Sheets into
-JSON output.
-
-
-OPTIONS
-
+NAME
+xlsx2json
+SYNOPSIS
+xlsx2json OPTIONS EXCEL_WORKBOOK_NAME
+[SHEET_NAME]
+DESCRIPTION
+xlsx2json is a tool that converts individual Excel Workbook Sheets
+into JSON output.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--N, -sheets
-
+- -N, -sheets
-
display sheet names in Excel Workbook
--
--c, -count
-
+- -c, -count
-
display number of sheets in Excel Workbook
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-This would get the sheet named “Sheet 1” from “MyWorkbook.xlsx” and save
-as sheet1.json
-
+EXAMPLES
+This would get the sheet named “Sheet 1” from “MyWorkbook.xlsx” and
+save as sheet1.json
xlsx2json MyWorkbook.xlsx "My worksheet 1" > sheet1.json
-
-This would get the number of sheets in the workbook
-
+This would get the number of sheets in the workbook
xlsx2json -count MyWorkbook.xlsx
-
-This will output the title of the sheets in the workbook
-
+This will output the title of the sheets in the workbook
xlsx2json -sheets MyWorkbook.xlsx
-
-Putting it all together in a shell script and convert all sheets to into
-JSON documents..
-
+Putting it all together in a shell script and convert all sheets to
+into JSON documents..
xlsx2json -N MyWorkbook.xlsx | while read SHEET_NAME; do
JSON_NAME="${SHEET_NAME// /-}.json"
xlsx2json -o "${JSON_NAME}" MyWorkbook.xlsx "$SHEET_NAME"
done
-
-xlsx2json 1.2.2
-
+xlsx2json 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us
diff --git a/yaml2json.1.html b/yaml2json.1.html
index 2553738..ccf6b7f 100644
--- a/yaml2json.1.html
+++ b/yaml2json.1.html
@@ -11,123 +11,70 @@
-
-NAME
-
-
-yaml2json
-
-
-SYNOPSIS
-
-
-yaml2json OPTIONS [YAML_FILENAME] [JSON_NAME]
-
-
-DESCRIPTION
-
-
-yaml2json is a tool that converts YAML into JSON. The program reads from
-standard input and writes to standard out.
-
-
-OPTIONS
-
+NAME
+yaml2json
+SYNOPSIS
+yaml2json OPTIONS [YAML_FILENAME]
+[JSON_NAME]
+DESCRIPTION
+yaml2json is a tool that converts YAML into JSON. The program reads
+from standard input and writes to standard out.
+OPTIONS
--
--help
-
+- -help
-
display help
--
--license
-
+- -license
-
display license
--
--version
-
+- -version
-
display version
--
--nl, -newline
-
+- -nl, -newline
-
if true add a trailing newline
--
--o, -output
-
+- -o, -output
-
output filename
--
--p, -pretty
-
+- -p, -pretty
-
pretty print output
--
--quiet
-
+- -quiet
-
suppress error messages
-
-EXAMPLES
-
-
-These would get the file named “my.yaml” and save it as my.json
-
+EXAMPLES
+These would get the file named “my.yaml” and save it as my.json
yaml2json my.yaml > my.json
yaml2json my.yaml my.json
cat my.yaml | yaml2json -i - > my.json
-
-yaml2json 1.2.2
-
+yaml2json 1.2.2
Caltech
-© 2021 Caltech library
+© 2023 Caltech library
1200 E California Blvd, Mail Code 1-32, Pasadena, CA 91125-3200
Phone: (626)395-3405
Email Us