Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/naoty/table
A command to print ASCII table from stdin
https://github.com/naoty/table
Last synced: 2 months ago
JSON representation
A command to print ASCII table from stdin
- Host: GitHub
- URL: https://github.com/naoty/table
- Owner: naoty
- License: mit
- Created: 2017-01-16T05:14:42.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-07-14T14:11:00.000Z (over 4 years ago)
- Last Synced: 2024-06-20T17:39:19.583Z (6 months ago)
- Language: Rust
- Size: 49.8 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# table
## Installation
```sh
$ brew tap naoty/misc
$ brew install table
```## Input Format
### TSV
```sh
$ 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.
```sh
$ echo -e "day\tDAU\n2017-01-01\t10000\n2017-01-02\t8000" | table -H
+------------+-------+
| day | DAU |
+------------+-------+
| 2017-01-01 | 10000 |
| 2017-01-02 | 8000 |
+------------+-------+
```### CSV
```sh
$ echo -e "2017-01-01,10000\n2017-01-02,8000" | table -f csv
+------------+-------+
| 2017-01-01 | 10000 |
| 2017-01-02 | 8000 |
+------------+-------+
```### JSONL (JSON Lines)
```sh
$ echo -n '{"day":"2020-01-01","DAU":10000}\n{"day":"2020-01-02","DAU":8000}' | table -f jsonl
+-------+------------+
| DAU | day |
+-------+------------+
| 10000 | 2020-01-01 |
| 8000 | 2020-01-02 |
+-------+------------+
```## Output Format
### ASCII
```sh
$ 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
```sh
$ 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 |
```