Skip to content

Commit

Permalink
improve csv display, documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wofr06 committed Oct 2, 2023
1 parent c06ba52 commit a9430ef
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
****************************************************************************
# ChangeLog for lesspipe.sh #
****************************************************************************
- preferred display of csv files is through the program column
- language recognition for bat improved
- correctly recognize the -r or -R option when calling less
- support for plain zlib files(used e.g. in backuppc, pdf)
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ the author by email.
the `file` command yielding a textual description or the file suffix is used
to determine what to display.

By default less wraps long lines unless called with the option -S or
--chop-long-lines. That can be changed interactively by typing -S followed by
ENTER when viewing files with long lines. It is e.g. quite useful for tabular
display of csv files with many columns.

## 2. Usage

(see also the man page lesspipe.1)
Expand Down Expand Up @@ -208,6 +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`
- rtf requires `unrtf` or `libreoffice`
- epub requires `pandoc`
- html,xml requires `w3m` or `lynx` or `elinks` or `html2text`
Expand All @@ -229,7 +235,7 @@ the author by email.
- MacOS X plist requires `plistutil`
- binary data requires `strings`
- json requires `jq`
- Device Tree Blobs(DTB) requires `dtc`
- device tree blobs requires `dtc` (extension dtb or dts)

To show the unmodified html, xml or perl pod text, append a colon to the file
name. Appending in addition the file type (html, xml, pod) produces a colored
Expand Down
2 changes: 1 addition & 1 deletion lesspipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ isfinal () {
has_cmd ccze && [[ $COLOR = *always ]] && ccze -A < "$1"
return ;;
csv)
{ has_cmd csvlook && cmd=(csvlook "$1"); } ||
{ has_cmd column && cmd=(column -o "|" -s " ,;" -t "$1"); } ||
{ has_cmd pandoc && cmd=(pandoc -f csv -t plain "$1"); } ;;
json)
[[ $COLOR = *always ]] && opt=(-C .) || opt=(.)
Expand Down
2 changes: 2 additions & 0 deletions packaging/lesspipe.spec
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ cd $RPM_BUILD_DIR
%docdir %{prefix}/share/man/man1

%changelog
* Mon Jun 26 2023 2.08-1 - wp.friebel@gmail.com
- improved coloring output, support for device tree blob files, bug fixes
* Sun Jan 08 2023 2.07-1 - wp.friebel@gmail.com
- support json, mail archives, update man page, other bat/batcat defaults
* Wed Aug 17 2022 2.06-1 20220817 - wp.friebel@gmail.com
Expand Down

0 comments on commit a9430ef

Please sign in to comment.