paperlined.org
external
document updated 11 years ago, on May 9, 2012

usage: align [ -s { s+ | s | t+ | t | _+ | _ | /patt } ]
       [ -j { s | t | _ | /string } ] [ -g # ] [ -t # ]
       [ -a { l | r | c | n | N | d | k }... ] [ { -e | -E } perlexpr ]
       [ file ... ]

        -s      split the input into columns defined by
                s+      one or more whitespace characters
                s       every whitespace character
                t+      one or more tab characters
                t       every tab character
                _+      one or more space characters
                _       every space character
                /patt   every occurrence of the given Perl regexp pattern

        -j      join the output into columns separated by
                s       tabs and spaces as needed
                t       only tabs (with all left alignment only)
                _       only spaces
                /string repetitions and a truncation of the given string

        -g      the minimum character places between output columns (gutter)

        -t      the number of character places taken by a full tab character

        -a      the alignment of each column with the last repeated as needed
                l       left
                r       right
                c       center
                n       numeric (aligned on the decimal point)
                N       numeric with decimal parts zero-padded
                d       default alignment from column contents
                k       no alignment (can unalign all rightward columns)

        -e      align only lines for which the given Perl expression is true

        -E      like -e but do not output unaligned lines


The default split method is determined by the following heuristic rules applied in order to the entire input:
        s+      if there are any adjacent tab and space characters
        t+      if there are any two adjacent tab characters
        t       if there is any tab character
        _+      if there are any two adjacent space characters
        _       otherwise

The default join method is determined by the split method as follows:
        t       if t+ or t (and all left aligned)
        s       if s+ or s or /patt
        _       otherwise

The default gutter value is 1.

The default tab value is $TABSTOP (), otherwise 8.

The default alignment is 'numeric' on columns of all numbers and 'left' on all other columns.

By default, all lines are aligned.  In a -e expression, $_ will be set to the current line.


Visual alignment may not be achieved if the column text or join string contains tabs, non-printing characters or other characters not occupying one character place.


Version 1.7.2