Closed tolot27 closed 1 year ago
That's useful.
Supported.
Use binaries here: https://github.com/shenwei356/csvtk/issues/91#issuecomment-1674416824
$ echo -e "contigs,sum_bases,cov,species\n37,31322,10.8,Homo sapiens\n1,11028,2388.5,Orthoflavivirus" \
| csvtk pretty -S plain -m 1 -r 2,3
contigs sum_bases cov species
37 31322 10.8 Homo sapiens
1 11028 2388.5 Orthoflavivirus
$ echo -e "contigs,sum_bases,cov,species\n37,31322,10.8,Homo sapiens\n1,11028,2388.5,Orthoflavivirus" \
| csvtk pretty -S plain -m contigs -r sum_bases,cov
contigs sum_bases cov species
37 31322 10.8 Homo sapiens
1 11028 2388.5 Orthoflavivirus
$ csvtk pretty testdata/names.csv -r 1,username -m first_name
┏━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━┓
┃ 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 ┃
┗━━━━┻━━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━┛
I'm using csvtk v0.26 and it would be great if
pretty
can be extended to align specific columns only, i. e. by specifying column numbers with-m, --align-center
and-r, --align-right
.Example of current output:
or
desired output: