Actions Status MetaCPAN Release

NAME

ansicolumn - ANSI terminal sequence aware column command

SYNOPSIS

ansicolumn [options] [file ...]

-w#, -c#             output width
-s#                  separator string
-t                   table style output
-l#                  maximum number of table columns
-x                   exchange rows and columns
-o#                  output separator
-R#                  right adjust table columns

-P[#], --page=#      page mode, with optional page length
-U[#], --up=#        show in N-up format (-WC# --linestyle=wrap)
--2up .. --9up       same as -U2 .. -U9
-D, --document       document mode
-V, --parallel       parallel view mode
-C#, --pane=#        number of panes
-S#, --pane-width=#  pane width
-W, --widen          widen to terminal width
-p, --paragraph      paragraph mode

-B, --border[=#]     print border with optional style
-F, --fillup[=#]     fill-up unit (pane|page|none)

--height=#           page height
--column-unit=#      column unit (default 8)
--margin=#           column margin width (default 1)
--linestyle=#        folding style (none|truncate|wrap|wordwrap)
--boundary=#         line-end boundary
--linebreak=#        line-break mode (none|all|runin|runout)
--runin=#            run-in width
--runout=#           run-out width
--run=#              set both run-in and run-out width
--[no-]pagebreak     allow page break
--border-style=#     border style
--[no-]ignore-space  ignore space in table output
--[no-]white-space   allow white spaces at the top of each pane
--[no-]isolation     page-end line isolation
--tabstop=#          tab-stop character
--tabhead=#          tab-head character
--tabspace=#         tab-space width
--tabstyle=#         tab style
--ambiguous=#        ambiguous character width (narrow|wide)

VERSION

Version 1.26

DESCRIPTION

ansicolumn is a column(1) command clone which can handle ANSI terminal sequences. It supports traditional options and some of Linux extended, and many other original options. Empty lines are not ignored, though.

In contrast to the original column(1) command which handles mainly short item list, and Linux variant which has been expanded to have ritch table style output, ansicolumn(1) has been expanded to show text file in multi-column view. Combined with pagenation and document-friendly folding mechanism, it can be used as a document viewing preprocessor for pager program.

When multiple files are given as arguments, it gets in the parallel view mode, and show all files in parallel. It's convenient to see multiple files side-by-side.

COMPATIBLE OPTIONS

The column utility formats its input into multiple columns. Rows are filled before columns. Input is taken from file operands, or, by default, from the standard input.

EXTENDED OPTIONS

CALCULATION

As for --height, --width, --pane and --pane-width options, besides giving numeric digits, you can calculate the number using terminal size. If the expression contains non-digit character, it is evaluated as an RPN (Reverse Polish Notation) with the terminal size pushed on the stack. Initial value for --height options is terminal height, and terminal width for others.

OPTION              VALUE
=================   =========================
--height 1-         height - 1
--height 2/         height / 2
--height 1-2/       (height - 1) / 2
--height dup2%-2/   (height - height % 2) / 2

Space and comma characters are ignored in the expression. So 1-2/ and 1 - 2 / and 1,-,2,/ are all same. See `perldoc Math::RPN` for the expression detail.

Next example select number of panes by dividing terminal width by 85:

ansicolumn --pane 85/

If you consider the case the terminal width is less than 85:

ansicolumn --pane 85/,DUP,1,GE,EXCH,1,IF

This RPN means $height/85 >= 1 ? $height/85 : 1.

STARTUP

This command is implemented with Getopt::EX module. So

~/.ansicolumnrc

file is read at start up time. If you want use --no-white-space always, put this line in your ~/.ansicolumnrc.

option default --no-white-space

Also command can be extended by original modules with -M option. See `perldoc Getopt::EX` for detail.

INSTALL

CPANMINUS

$ cpanm App::ansicolumn

To get the latest code, use this:

$ cpanm https://github.com/kaz-utashiro/App-ansicolumn.git

EXAMPLES

https://github.com/kaz-utashiro/App-ansicolumn/tree/master/images

SEE ALSO

column(1), https://man7.org/linux/man-pages/man1/column.1.html

App::ansicolumn, https://github.com/kaz-utashiro/App-ansicolumn

Text::ANSI::Printf, https://github.com/kaz-utashiro/Text-ANSI-Printf

AUTHOR

Kazumasa Utashiro

LICENSE

Copyright 2020-2022 Kazumasa Utashiro.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.