NAME

col - filter reverse line feeds from input

SYNOPSIS

col [-bfhpstx] [-l num]

DESCRIPTION

col filters out reverse (and half-reverse) line feeds so that the output is in the correct order with only forward and half-forward line feeds, and replaces whitespace characters with tabs where possible. This can be useful in processing the output of nroff(1) and tbl(1).

col reads from the standard input and writes to the standard output.

OPTIONS

col accepts the following standard options:

-b

Do not output any backspaces, printing only the last character written to each column position.

-f

Forward half-line feeds are permitted ("fine" mode). Without this option, characters which would be printed on a half-line boundary are printed on the following line.

-h

Compress spaces into tabs. This option is the default behavior.

-p

Output unrecognized escape sequences. Without this option, unrecognized escape sequences are ignored. Because escape sequences may be overprinted from reverse line feeds, the use of this option is highly discouraged unless the user is fully aware of the textual position of the escape sequences.

-x

Output multiple spaces instead of tabs. Tab stops are eight characters apart. This option takes precedence over the -h option.

-l num

This option is ignored for compatibility reasons.

col also accepts the following options for compatibility with other implementations:

-s

Shift in before each line feed when in the alternate character set (as in IRIX col). Without this option, col only shifts in before the final line endings (as in BSD col).

-t

Ignore trailing input that is not followed by a line feed (as in IRIX col). Without this option, a final line feed is not necessary (as in BSD col.)

The control sequences and their decimal ASCII values that col understands are listed in the following table:

ESC-7            Reverse line feed (escape then 7).
ESC-8            Half reverse line feed (escape then 8).
ESC-9            Half forward line feed (escape then 9).
backspace        Moves back one column (8); ignored in the first column.
carriage return  (13)
newline          Forward line feed (10); also does carriage return.
shift in         Shift to normal character set (15).
shift out        Shift to alternate character set (14).
space            Moves forward one column (32).
tab              Moves forward to next tab stop (9).
vertical tab     Reverse line feed (11).

BUGS

This implementation of col has no known bugs.

CAVEATS

Reverse line feeds and half reverse line feeds which would move past the start of the buffer are ignored.

Unrecognized control characters are ignored.

Unrecognized escape sequences are ignored, unless the -p option is used.

Some versions of col for BSD may convert spaces to tabs incorrectly. This implementation of col does not emulate that bug. The col utilities on other systems may have further differences in behavior.

AUTHOR

This implementation of col in Perl was written by Ronald J Kimball, rjk-perl@tamias.net

COPYRIGHT and LICENSE

This program is copyright 2000 by Ronald J Kimball.

This program is free and open software. You may use, modify, or distribute this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same.