Skip to content

Commit

Permalink
reintroduce csvlook and new program csvtable for csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
wofr06 committed Jan 17, 2024
1 parent 6c0daf1 commit 35ffb99
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
****************************************************************************
# ChangeLog for lesspipe.sh #
****************************************************************************
- use again csvlook for display of csv files if available
- use csvtable for tabular display of csv files, needs Text::CSV from perl
Version 2.11 Dec 13 2023
- fix output of archive listings when no coloring is requested
- column does not accept std input
Expand Down
3 changes: 3 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ Execute the following commands (for a more detailed description see below):
./configure
# required
cp lesspipe.sh /usr/local/bin

# optional for colorizing and old openoffice writer formats
cp code2color archive_color vimcolor sxw2txt lesscomplete /usr/local/bin

# optional for zsh and bash completion (archive contents)
cp lesscomplete /usr/local/bin # (zsh and bash)
cp _less /usr/share/zsh/site-functions #(zsh)
cp less_completion /etc/bashcompletion.d #(bash)

or if you prefer make:

make
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ the author by email.
- MS Word (docx) requires `pandoc` or `docx2txt` or `libreoffice`
- Powerpoint (pptx) requires `pptx2md` or `libreoffice`
- Excel (xlsx) requires `in2csv` or `xlscat` or `excel2csv` or `libreoffice`
- csv requires `column` or `pandoc`
- csv requires `csvtable` or `csvlook` or `column` or `pandoc`
- rtf requires `unrtf` or `libreoffice`
- epub requires `pandoc`
- html,xml requires `w3m` or `lynx` or `elinks` or `html2text`
Expand Down Expand Up @@ -404,6 +404,7 @@ filtering for certain file types.
- cabextract https://www.cabextract.org.uk/ (2019)
- catdoc,catppt,xls2csv https://www.wagner.pp.ru/~vitus/software/catdoc/ (2016)
- ccze https://github.com/cornet/ccze (2011)
- csvtable https://github.com/wofr06/csvtable (2024)
- djvutxt https://sourceforge.net/projects/djvu/ (2021)
- docx2txt https://docx2txt.sourceforge.net/ (2014)
- dvi2tty https://www.ctan.org/tex-archive/dviware/dvi2tty/ (2016)
Expand Down
3 changes: 3 additions & 0 deletions lesspipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,9 @@ isfinal () {
has_cmd ccze && [[ $COLOR = *always ]] && ccze -A < "$1"
return ;;
csv)
msg "type -S<ENTER> for better display of very wide tables"
{ has_cmd csvtable && csvtable -h >/dev/null 2>&1 && cmd=(csvtable "$1"); } ||
{ has_cmd csvlook && cmd=(csvlook -S "$1"); } ||
{ has_cmd column && cmd=(istemp "column -s ,; -t" "$1"); } ||
{ has_cmd pandoc && cmd=(pandoc -f csv -t plain "$1"); } ;;
json)
Expand Down

0 comments on commit 35ffb99

Please sign in to comment.