Transform CSV files using familiar spreadsheet formulas from the command line.
Tabula is a command-line tool that brings the power of spreadsheet calculations to CSV file processing.
Your data should be yours - not locked in proprietary formats or cloud services:
- π Store anywhere - Local files, git repos, network drives, your choice
- π Share when you want - No forced cloud sync or account requirements
- π Plain text - CSV files are readable, editable, and future-proof
- π Use any tool - Works with grep, sed, awk, and all text utilities
- π Universal format - Open in Excel, Google Sheets, databases, or any CSV-compatible tool
Why install a multi-gigabyte office suite when you only need basic calculations?
- πͺΆ Tiny footprint - Single < 5MB binary, no installers, no dependencies
- π Fast - Processes large files efficiently from the command line
- π Cross-platform - macOS, Linux, Windows - works everywhere
- π» Scriptable - Integrates with shell scripts, CI/CD, and automation tools
Both your data AND transformations are text files:
- β
Git-friendly - Track changes to CSV data and
.tblscripts - β Diff & merge - See exactly what changed in your data
- β Collaborate - Share scripts and data through version control
- β Reproducible - Exact same results every time you run a script
- β Documented - Scripts serve as documentation for your transformations
- π Spreadsheet syntax - Cell references (A1, B2), functions SUM, IF, etc
- π’ Rich function library - 50+ built-in functions for numbers, text, dates, logic
- π― Purpose-built - Designed specifically for CSV transformation, not generic programming
Download the binary for your system:
https://pblazh.github.io/tabula/
Or build from source
Input CSV (sales.csv):
Product , Price , Quantity
Apple , 1.20 , 10
Cherry , 2.50 , 8
Banana , 0.80 , 15Or user markdown as an input and output
| Product | Price | Quantity |
| ------- | ----- | -------- |
| Apple | 1.20 | 10 |
| Cherry | 2.50 | 8 |
| Banana | 0.80 | 15 |Script (script.tbl):
// Add header for total column
let D1 = "Total";
// Calculate total for each row
let D2:D4 = REF(REL(-2,0)) * REF(REL(-1,0));
// Add a grand total row
let A5 = "TOTAL";
let D5 = SUM(D2:D4);
Run:
tabula -a -s script.tbl -i sales.csvOutput:
Product , Price , Quantity , Total
Apple , 1.20 , 10 , 12
Cherry , 2.50 , 8 , 20
Banana , 0.80 , 15 , 12
TOTAL , , , 44# Use grep to find rows
grep "Alice" data.csv | tabula -s transform.tbl
# Pipe through standard Unix tools
# calculate sales and output sorted by total
head -n1 sales.csv ; tabula -s script.tbl -i sales.csv | tail -n +2 | sort -t, -k3 -nr
# Combine with git
git diff data.csv # See exactly what changed
git log transform.tbl # Track transformation history
# etcYour CSV output works everywhere:
- π Import into Excel, Google Sheets, Numbers, etc
- ποΈ Load into databases (PostgreSQL, MySQL, SQLite, etc)
- π Visualize with Tableau, Power BI, R, Python, etc
- π Publish to GitHub, static sites, or data portals
- π§ Email as attachments without format issues
- β Data is yours - readable in any text editor
- β Scripts are portable - run anywhere
- β No subscriptions, no accounts, no cloud requirements
- β Works offline - no internet needed
- β Free & open source - use without restrictions
For complete documentation, see doc/README.md
- Vim/Neovim - Auto-execution on save of markdown and csv files. Markdown code-block support for CSV and Tabula scripts. Syntax highlighting for
*.tblfiles. - Visual Studio Code - Auto-execution on save of markdown and csv files. Markdown code-block support for CSV and Tabula scripts. Syntax highlighting for
*.tblfiles. - Obsidian - Auto-execution on save of markdown files. Code-block support for CSV and Tabula scripts.
- Web Storm - Auto-execution on save of markdown and csv files. Code-block support for CSV and Tabula scripts. Syntax highlighting for
*.tblfiles.
GNU General Public License v3.0
If you find this project useful, consider:
- β Starring the GitHub repository
- π Reporting issues or suggesting features
- π Contributing to the documentation
