Commit 97587916 authored by Ian Dennis Miller's avatar Ian Dennis Miller

docs

parent 531d502b
# csv-unix
# CSV UNIX
CSV operations with a UNIX philosophy.
CSV operations with UNIX pipes.
Work on large CSV files without loading the whole file in memory.
CSV UNIX can be used to build pipelines for streaming computations.
Use the UNIX pipe "|" to chain together commands and filters.
The syntax is reminiscent of SQL.
## Installation
```
CSV_SRC="$HOME/.csv-functions.sh"
CSV_URL='https://projects.sisrlab.com/idm/csv-unix/raw/master/csv-functions.sh'
wget -O $CSV_SRC $CSV_URL
source $CSV_SRC
wget https://projects.sisrlab.com/idm/csv-unix/raw/master/csv-unix.sh
source csv-unix.sh
csv.install
```
## Examples
### Obtain file listing as CSV and display file sizes
csv ls | csv select 5
### Calculate average file size
csv ls | csv select 5 | csv mean
## Commands
- read [file]
- select [cols]
- names [file]
- limit [num]
- ls [path]
- benchmark [file]
- version
- help
## Filters
- collapse (piped)
- unquote (piped)
- split (piped)
- sum (piped)
- mean (piped)
- count (piped)
## About
https://www.sisrlab.com
......@@ -4,8 +4,8 @@
# When files are too large to fit into memory, streaming might be the only alternative.
PROFILE="$HOME/.profile"
CSV_SRC="$HOME/.csv-functions.sh"
CSV_URL='https://projects.sisrlab.com/idm/csv-unix/raw/master/csv-functions.sh'
CSV_SRC="$HOME/.csv-unix.sh"
CSV_URL='https://projects.sisrlab.com/idm/csv-unix/raw/master/csv-unix.sh'
# collapse fields containing newlines
csv.collapse() {
......@@ -72,7 +72,8 @@ csv.update() {
# make installation permanent
csv.install() {
if [[ -z `grep csv-functions.sh $PROFILE` ]];
csv.update
if [[ -z `grep csv-unix.sh $PROFILE` ]];
then echo "source $CSV_SRC" >> $PROFILE;
fi
}
......@@ -162,4 +163,3 @@ _csv_completion()
}
complete -F _csv_completion csv
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment