tabbs-0.2.0 is not a library.
tabbs
A command line tool for displaying delimiter-separated data as a table in the terminal.
Features
- Takes input from stdin or a file
- Supports specifying column names or using first row as header
- Customizable delimiter (comma, tab, pipe, etc.)
- Right-align numeric columns
- Configurable header and cell colors
- Easy to use
Installation
To install tabbs, you will need Rust and Cargo installed on your system.
Or install from crates.io:
Usage
Pipe delimiter-separated data to tabbs and specify column names with the -c flag:
|
Output:
+------+-----+------+
| name | age | text |
+------+-----+------+
| jack | 35 | neat |
| jane | 50 | cool |
| erin | 20 | nice |
+------+-----+------+
Command line options
| Option | Short | Description |
|---|---|---|
--columns |
-c |
Column names, separated by the delimiter (required unless --header-row) |
--file |
-f |
Read input from file instead of stdin |
--delimiter |
-d |
Field delimiter (default: ,) |
--header-row |
Use the first line of input as column names | |
--no-header |
Do not print the header row | |
--align-numeric |
Right-align columns that contain only numbers | |
--header-color |
Color for the header row | |
--cell-color |
Color for cell text | |
--help |
-h |
Print help |
Supported colors: black, red, green, yellow, blue, magenta, cyan, white, and their bright_ variants.
File input
Read from a file with -f:
Header from first row
When your data includes a header line, use --header-row instead of -c:
|
Right-align numbers
Use --align-numeric to right-align columns where all values are numbers:
|
Custom delimiter
Use -d or --delimiter for tab-separated, pipe-separated, or other formats:
# Tab-separated (use $'\t' in bash; column names must use the same delimiter)
|
# Pipe-separated
|
Colors
|
Limitations
- Simple delimiter-separated parsing only; quoted fields (e.g.
"Smith, John",42) are not supported - Rows with fewer columns than the header are padded with empty cells
- Rows with more columns than the header are truncated
- Empty lines in input are skipped
- Input is read fully into memory (very large files may use significant memory)
Contributing
Contributions are welcome. Please open an issue or pull request on GitHub.
License
MIT License. See LICENSE for details.