wofr06 / lesspipe

lesspipe - display more with less
GNU General Public License v2.0
484 stars 51 forks source link

Add tsv support #126

Closed gdevenyi closed 1 year ago

gdevenyi commented 1 year ago

Pandoc from format supports tsv (tab-seperated csv). The same code which does csv should be able to handle this.

wofr06 commented 1 year ago

I have installed pandoc 2.9.2.1, there is no tsv input format and a tab separated file I have (converted from csv) is displayed differently than csv files. In addition csv files are recognized by file --mime while my tsv file is recognized as plain text only. The csvlook program would handle tab separated files, but then additional code would be required to force files with an csv ending to get processed as csv files independently of its contents. Maybe a private lessfilter would be appropriate.

gdevenyi commented 1 year ago

Looks like it was added in 3.1.1 https://pandoc.org/releases.html#pandoc-3.1.1-2023-03-05

Using the same pandoc -f csv with tsv does give a formatted table for viewing.

I agree the file issue is a problem for automatic detection. I presumed you were using the extension.

wofr06 commented 1 year ago

I will reconsider this proposed enhancement when the file command reports these files as being tsv or csv files. Until then a private lessfilter could help.