shenwei356 / csvtk

A cross-platform, efficient and practical CSV/TSV toolkit in Golang
http://bioinf.shenwei.me/csvtk
MIT License
999 stars 84 forks source link

mark when record is truncated by `csvtk pretty` with `-W` #228

Closed skywyx closed 1 year ago

skywyx commented 1 year ago

I think it's better to mark it when a record is truncated by csvtk pretty with -W. e.g.

# cat test.csv
a,b,c
aa,bb,cc
aaa,bbb,ccc

when use cmd cat test.csv|csvtk pretty -W 2 it's better to show as

a       b       c
--...   --...   --...
aa      bb      cc
aa...   bb...   cc...

just like it was shown with pandas

shenwei356 commented 1 year ago

Thanks for your suggestion. It's easy to achieve by forking https://github.com/tatsushid/go-prettytable/ and editing the function truncateString.

But I might use other new methods. #206

shenwei356 commented 1 year ago

Implemented. Please check here: https://github.com/shenwei356/csvtk/issues/206#issuecomment-1609358555