Pipeline Mode
VimSheet can operate non-interactively as a UNIX pipeline tool, reading input from stdin and writing output to stdout.
Basic Usage
$ cat data.csv | vimsheet --nocurses "=SUM(A:A)" > result.txt
$ echo "1 2 3" | vimsheet --nocurses "=AVERAGE(A1:C1)"
$ vimsheet --nocurses --script transform.vsheet --output result.xlsx
Pipeline Commands
Command |
Description |
|---|---|
|
Enable non-interactive pipeline mode |
|
Run a |
|
Write output to file (detects format from extension) |
|
Evaluate a single formula and print the result (positional arg) |
Script File Format (.vsheet)
Script files use a simple DSL:
open data.csv
addsheet Summary
set A1 "Total"
formula B1 =SUM(Sheet1!B:B)
save result.xlsx
Available script commands:
Examples
Compute column statistics:
$ cat sales.csv | vimsheet --nocurses "=SUM(B:B)"
$ cat sales.csv | vimsheet --nocurses "=AVERAGE(B:B)"
$ cat sales.csv | vimsheet --nocurses "=MAX(B:B)"
Transform data with formulas:
$ cat data.csv | vimsheet --nocurses "=UPPER(A1)" > uppercased.csv
Batch convert files:
$ for f in *.csv; do
echo "open $f" > /tmp/convert.vsheet
echo "save ${f%.csv}.xlsx" >> /tmp/convert.vsheet
vimsheet --nocurses --script /tmp/convert.vsheet
done