https://github.com/dlesbre/csv2mdtable
Simple C++ program to transform csv files into pretty markdown tables
https://github.com/dlesbre/csv2mdtable
c-plus-plus converter csv markdown
Last synced: 12 months ago
JSON representation
Simple C++ program to transform csv files into pretty markdown tables
- Host: GitHub
- URL: https://github.com/dlesbre/csv2mdtable
- Owner: dlesbre
- License: mit
- Created: 2021-01-18T15:28:04.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-18T16:23:48.000Z (about 5 years ago)
- Last Synced: 2025-02-13T06:41:13.214Z (about 1 year ago)
- Topics: c-plus-plus, converter, csv, markdown
- Language: C++
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# csv2mdtable
Simple C++ console program to transform csv files into pretty markdown tables.
Simple example:
```
col 1,col 2,col 3,col 4 |col 1|col 2|col 3|col 4|
5,6,7,8 -> |-----|-----|-----|-----|
9,10,11,12 |5 |6 |7 |8 |
|9 |10 |11 |12 |
```
Which renders as
|col 1|col 2|col 3|col 4|
|-----|-----|-----|-----|
|5 |6 |7 |8 |
|9 |10 |11 |12 |
## Installation
1. Download or clone this repository
2. Run `make` (or `cmake` directly)
3. Place the executable `csv2mdtable` anywhere on your path
## Usage
Command line arguments:
- `-i ` input file in csv format. Read standard input if absent
- `-o ` output file. Print to standard output if absent
- `-a ` column alignement (string of `'l'`, `'c'`, `'r'`, `'_'`) specifying if each column is left aligned, centered, right aligned or unspecified.
- `-c ` column separation character, attempts to autodetermine if absent.
Autodetermine chooses between these characters `'\t'`, `','`, `';'`, `'.'`, `' '`.
- `-l ` line separation character, default is `\n`
- `-no-pad` don't autopad columns to have same width
- `-no-pipes` don't place external pipes (leftmost and rightmost)
- `-h --help` show help
- `-v --version` show version number