Skip to content

KrisCien/bash-ascii-table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bash-ascii-table

Display tabular data in ascii table works with bash 3.2 or later

Usage

Copy function print_table into your script, profit.

Example:

print_table ";"      \
 "h0*;h1;h2"         \
 "g0;[0, 1];[0, 2]"  \
 "g0;[1, 1];[1, 2]"  \
 "g1;[2, 1];[2, 2]"  \
 "g1;[2, 1];[2, 2]"  \
 "g1;[3, 1];[3, 2]"

Will print this table:

| h0 | h1     | h2     |
|----+--------+--------|
| g0 | [0, 1] | [0, 2] |
|    | [1, 1] | [1, 2] |
|----+--------+--------|
| g1 | [2, 1] | [2, 2] |
|    | [2, 1] | [2, 2] |
|    | [3, 1] | [3, 2] |

See: demo.sh for more usage examples.

About

Format table data in ascii table

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages