csvtk v0.3
- add subcommand
csv2md
csv2md
Usage
convert CSV to markdown format
Usage:
csvtk csv2md [flags]
Flags:
-a, --alignments string comma separated alignments. e.g. -a l,c,c,c or -a c
-w, --min-width int min width (default 3)
Examples
-
give single alignment symbol
$ cat names.csv | csvtk csv2md -a left id |first_name|last_name|username :--|:---------|:--------|:------- 11 |Rob |Pike |rob 2 |Ken |Thompson |ken 4 |Robert |Griesemer|gri 1 |Robert |Thompson |abc NA |Robert |Abel |12
result:
id first_name last_name username 11 Rob Pike rob 2 Ken Thompson ken 4 Robert Griesemer gri 1 Robert Thompson abc NA Robert Abel 12 -
give alignment symbols of all fields
$ cat names.csv | csvtk csv2md -a c,l,l,l id |first_name|last_name|username :-:|:---------|:--------|:------- 11 |Rob |Pike |rob 2 |Ken |Thompson |ken 4 |Robert |Griesemer|gri 1 |Robert |Thompson |abc NA |Robert |Abel |123
result
id first_name last_name username 11 Rob Pike rob 2 Ken Thompson ken 4 Robert Griesemer gri 1 Robert Thompson abc NA Robert Abel 123