Skip to content
A command to print ASCII table from stdin
Branch: master
Clone or download
Latest commit 886ec39 Mar 5, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
readers Add JSONReader Mar 5, 2018
table Add TSVReader Mar 2, 2018
utils Split codes into some packages Mar 1, 2018
writers Rename drawer to writer Mar 3, 2018
.gitignore Add 'make release' to create a tarball for upload Feb 20, 2017
CHANGELOG.md Update CHANGELOG Mar 5, 2018
LICENSE Initial commit Jan 16, 2017
Makefile Add 'make release' to create a tarball for upload Feb 20, 2017
README.md Update README Mar 5, 2018
cli.go Add json to format option Mar 5, 2018
main.go Fix Version Mar 5, 2018

README.md

table

Installation

$ brew tap naoty/misc
$ brew install table

Input Format

TSV

$ echo -e "2017-01-01\t10000\n2017-01-02\t8000" | table
+------------+-------+
| 2017-01-01 | 10000 |
| 2017-01-02 | 8000  |
+------------+-------+

-H or --header option adds headers to the table.

$ echo -e "day\tDAU\n2017-01-01\t10000\n2017-01-02\t8000" | table -H
+------------+-------+
| day        | DAU   |
+------------+-------+
| 2017-01-01 | 10000 |
| 2017-01-02 | 8000  |
+------------+-------+

JSON

$ echo '[{"id":1,"name":"bulbasaur"},{"id":2,"name":"ivysaur"}]' | table -f json:ascii
+----+-----------+
| id | name      |
+----+-----------+
| 1  | bulbasaur |
| 2  | ivysaur   |
+----+-----------+

Output Format

ASCII

$ echo -e "day\tDAU\n2017-01-01\t10000\n2017-01-02\t8000" | table -H -f tsv:ascii
+------------+-------+
| day        | DAU   |
+------------+-------+
| 2017-01-01 | 10000 |
| 2017-01-02 | 8000  |
+------------+-------+

Markdown

$ echo -e "day\tDAU\n2017-01-01\t10000\n2017-01-02\t8000" | table -H -f tsv:markdown
| day        | DAU   |
| ---------- | ----- |
| 2017-01-01 | 10000 |
| 2017-01-02 | 8000  |

Confluence

$ echo -e "day\tDAU\n2017-01-01\t10000\n2017-01-02\t8000" | table -H -f tsv:confluence
||day        ||DAU   |
| 2017-01-01 | 10000 |
| 2017-01-02 | 8000  |
You can’t perform that action at this time.