Releases: caltechlibrary/datatools
jsonjoin
Harmonizing csv commands
All the csv commands now support setting a character delimiter. This allows us to use the csv commands with other delimiters (e.g. colon or pipe delimited files). Unless noted the delimiter affects both input and output.
Here's an example of using csvfind one a pipe delimited file called file.txt looking for "Fred" in the second
column.
csvfind -i file.txt -d '|' -col 2 "Fred"
Combined release of shelltools and datatools
This release marks the merging of shelltools and datatools projects. Moving forward improvements, bug fixes will happen in the datatools project.
New parameters and installation process
The primary feature of this release is individual Zip files for compiled binaries based on platform. Additional two commands, jsoncols and jsonrange, now have a "-permissive" option which suppress errors codes and messages (useful in Bash scripting where an empty string is sufficient).
Column counting from 1 instead of zero
I've updated the command line options for csvcols, csvfind and csvjoin to reference column number starting with column one rather than column zero. This makes the behavior match how cut works (e.g. -f 1 for first field) as well as how most people think of counting columns in spreadsheets.
new cli, bug fixes and cli option normalization
Changes:
- csvcols has an option change, -f is now -col
Additions:
- csvfind will help you find things in a CSV file by searching a single colum
- search options include exact match, contains and Levenshtein edit distance
- csvjoin will let you join two CSV files on a column
- includes support for approximate matching via Lenenshtein edit distance on join column
Documentation has been re-organized. Beginning to add a "How To" section for website. Lots of small BUG fixes.
datatools Go package is beginning to combine common functionality used between the CLI. dotpath continues to be debugged.
Added csv2json cli
Added a new command line tool named csv2json. This will convert a CSV file into a series of JSON blobs output as either a JSON array or one JSON blob per line. Use case is turning a CSV file into a set of JSON blobs that could be easily stored in dataset.
Minor tweaks, bug fixes and improvements
- Adding leading and trailing new line for CSV to Markdown table conversion (csv2mdtable).
- Improved docs.
- Linted and formatted Bash scripts.
- Improved Makefile
jsonrange refinement
In this release updates were focused on jsonrange. It now returns keys by default, handles input/output like jsoncols and can returns lengths or last key index, and values depending on how you set options.
dotpath replacing jid
The primary purpose of the release is the swapping out of jid for a local submodule named dotpath.
This removes a dependency for an external package and keeps the code minimal (dot path in only about 150 lines). It does mean that interactive mode of jsoncols has been removed. If you need this then use jid which is nice for this type of exploration. There are sure to be bugs introduced by this switch... YMMV