Skip to content

zhengxinchang/ttable-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ttable-rs

A standalone table formatter to view tabular data in console.

Motivation

ttable is inspired by the excellent Python based tabular viewer tabview. ttable implemented the basic function which can read stdin and format it into stdout with formatted table. This small program is useful if you just need a tabular data formatter and do not want to install other prerequisites such as Conda.

Current version is a basic wrapper of prettytable-rs.

Installation

You just need to download the binary file to your system and make it executable by using chmod a+x ttable

How to use

# Parameters
<some command> | ttable         // Will use \t as delimiter as default.
<some command> | ttable -d ','  // Will use user specified ',' as delimiter.
<some command> | ttable -r      // Will show row index.
<some command> | ttable -c      // Will show column index.
<some command> | ttable -a      // Will show row and column index.
<some command> | ttable -m 1000 // Will show the first 1000 lines. Default = 50000

# Use ttable in pipeline
<some command> | ttable [options] | <some command>

Output

Row Index
  |
+---+------+--------+-----+
| 0 | 1    | 2      | 3   | --- Column Index
+===+======+========+=====+
| 1 | Name | Sex    | Age |
+---+------+--------+-----+
| 2 | Tom  | Male   | 18  |
+---+------+--------+-----+
| 3 | Bob  | Male   | 16  |
+---+------+--------+-----+
| 4 | Zoe  | Female | 23  |
+---+------+--------+-----+

About

Rust based pretty table in console

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages