Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/selenebun/rtab
A command-line tool for generating tables from CSV.
https://github.com/selenebun/rtab
csv table
Last synced: 3 months ago
JSON representation
A command-line tool for generating tables from CSV.
- Host: GitHub
- URL: https://github.com/selenebun/rtab
- Owner: selenebun
- License: mit
- Archived: true
- Created: 2021-04-24T12:44:59.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-06T15:41:36.000Z (over 3 years ago)
- Last Synced: 2024-08-06T06:05:48.738Z (3 months ago)
- Topics: csv, table
- Language: Rust
- Homepage:
- Size: 25.4 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rtab
A command-line tool for generating tables from CSV.
## Examples
All of the below examples will use the following CSV file as input.
```csv
,Labial,Alveolar,Dorsal
Plosive,p,t,k
Nasal,m,n,
Fricative,,s,
Approximant,w,l,j
```The basic style can be specified with the `--style` option, defaulting to
`basic`.```
$ rtab input.csv
Labial Alveolar Dorsal
Plosive p t k
Nasal m n
Fricative s
Approximant w l j$ rtab input.csv --style fancy
┌─────────────┬────────┬──────────┬────────┐
│ │ Labial │ Alveolar │ Dorsal │
│ Plosive │ p │ t │ k │
│ Nasal │ m │ n │ │
│ Fricative │ │ s │ │
│ Approximant │ w │ l │ j │
└─────────────┴────────┴──────────┴────────┘
```Additional spacing can be added with the `--spaces` (or `-s`) option.
```
$ rtab input.csv -s2
Labial Alveolar Dorsal
Plosive p t k
Nasal m n
Fricative s
Approximant w l j
```The `--spaces` option works similarly for the `fancy` style.
The `fancy` style can be further customized with the `--headers` and
`--separators` flags.```
$ rtab input.csv --style fancy --headers
┌─────────────┬────────┬──────────┬────────┐
│ │ Labial │ Alveolar │ Dorsal │
├─────────────┼────────┼──────────┼────────┤
│ Plosive │ p │ t │ k │
│ Nasal │ m │ n │ │
│ Fricative │ │ s │ │
│ Approximant │ w │ l │ j │
└─────────────┴────────┴──────────┴────────┘$ rtab input.csv --style fancy --separators
┌─────────────┬────────┬──────────┬────────┐
│ │ Labial │ Alveolar │ Dorsal │
├─────────────┼────────┼──────────┼────────┤
│ Plosive │ p │ t │ k │
├─────────────┼────────┼──────────┼────────┤
│ Nasal │ m │ n │ │
├─────────────┼────────┼──────────┼────────┤
│ Fricative │ │ s │ │
├─────────────┼────────┼──────────┼────────┤
│ Approximant │ w │ l │ j │
└─────────────┴────────┴──────────┴────────┘
```