col [-bfpx] [-l num]

Filters out reverse (and half reverse) line feeds so the output is in the correct order with only forward and half forward line feeds, and
replaces white-space with tabs or with replaces tabs with spaces..

Useful for processing output of nroff and tbl.

-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).
Default: characters printed on a half line boundary are printed on the following line.

-p Pass unknown control sequences through unchanged.
Default: col removes control sequences other than those recognized.

-x Output multiple spaces instead of tabs.

-l num Buffer at least num lines in memory. Default, 128 lines are buffered.

The control sequences for carriage motion that col understands :

carriage return newline forward line feed ;
also does carriage return
(i.e. sets to first column)
ESC-7 reverse line feed ESC-8 half reverse line feed
vertical tab
reverse line feed
ESC-9 half forward line feed
space moves forward one column tab moves forward to next tab stop
backspace moves back one column
(ignored in the first column)
shift out shift to alternate character set
shift in shift to normal character set

Unrecognized control characters and escape sequences are discarded.

Col keeps track of the character set as characters are read and makes sure the character set is correct when they are output.

If the input attempts to back up to the last flushed line, col will display a warning message.

SEE ALSO expand, nroff, tbl, column