tabx
A simple, fast command-line tool to convert between table formats (Markdown, MySQL, PostgreSQL, CSV, TSV) with automatic format detection.
Installation
# Build from source
# Install globally
Usage
# Basic usage - reads stdin, writes stdout
| |
# Convert to CSV
|
# Force input format
|
Examples
# Database output to spreadsheet
|
| |
# File conversion
|
| |
# Pipeline composition
| | |
| |
Supported Formats
| Format | Auto-detection | Example Source |
|---|---|---|
| MySQL | +---+ borders |
mysql -e "SELECT ..." |
| PostgreSQL | ----+---- separators |
psql -c "SELECT ..." |
| Markdown | |---| separator lines |
Documentation tables |
| CSV | Comma-separated | Data files, Excel exports |
| TSV | Tab-separated | Spreadsheet exports |
Output formats: TSV (default), CSV, or custom delimiter.
Command-line Options
Usage: tabx [OPTIONS]
Options:
-i, --input-format <FORMAT> Force input format (auto, markdown, mysql, postgres, csv, tsv)
-o, --output-format <FORMAT> Output format (tsv, csv) [default: tsv]
-d, --delimiter <CHAR> Custom output delimiter
--input-delimiter <CHAR> Custom input delimiter for CSV/TSV
-h, --help Print help
-V, --version Print version
Delimiter Requirements:
- Must be a single ASCII character
- Control characters are not allowed (except tab
\tfor TSV) - Common valid delimiters:
,(comma),|(pipe),;(semicolon),:(colon)
Format Examples
MySQL → TSV
|
+----+-------+ id name
| id | name | → 1 Alice
+----+-------+ 2 Bob
| 1 | Alice |
| 2 | Bob |
+----+-------+
Markdown → CSV
|
| API | Method | API,Method
|-----|---------| → /users,GET
| /users | GET | /posts,POST
| /posts | POST |
PostgreSQL → TSV
|
id | name id name
----+------- → 1 Coffee
1 | Coffee 2 Tea
2 | Tea
Development