1
0
mirror of https://github.com/anthonyaxenov/csv2md.git synced 2024-12-28 00:48:31 +00:00
Stupidly simple tool to convert csv-file to markdown table
Go to file
2022-02-17 13:12:11 +08:00
.vscode Update launch.json to debug in vscode 2022-02-17 13:07:05 +08:00
.gitignore Update .gitignore for md files 2022-02-17 13:07:22 +08:00
example.csv Update example.csv for more test data 2022-02-17 13:07:42 +08:00
go.mod Initial version 1.0.0 2022-02-16 17:49:22 +08:00
LICENSE Initial version 1.0.0 2022-02-16 17:49:22 +08:00
main.go New version 2022-02-17 13:11:59 +08:00
Makefile Initial version 1.0.0 2022-02-16 17:49:22 +08:00
README.md Update readme 2022-02-17 13:12:11 +08:00

csv2md

Stupidly simple tool to convert csv-file to markdown table.

Outputs result in stdout.

Usage

csv2md (-h|-help|--help|help)    # to get this help
csv2md example.csv               # convert data from file and write result in stdout
csv2md < example.csv             # convert data from stdin and write result in stdout
cat example.csv | csv2md         # convert data from stdin and write result in stdout
csv2md example.csv > example.md  # convert data from file and write result in new file
csv2md example.csv | less        # convert data from file and write result in stdout using pager
csv2md                           # paste or type data to stdin by hands
                                 # press Ctrl+D to view result in stdout
csv2md > example.md              # paste or type data to stdin by hands
                                 # press Ctrl+D to write result in new file

...anything is possible with redirection and piping

IMPORTANT:

  • input must be valid csv
  • whitespaces allowed only between double-quotes

Examples can be found here: https://people.sc.fsu.edu/~jburkardt/data/csv/csv.html

Compilation

  1. Install go.
  2. Download this repo via zip or git clone.
  3. Run make help to get help or go run . <csv_path> to build and run temporary binary.

License

MIT