version 1.8, 2011/12/28 22:27:18 |
version 1.9, 2016/01/18 20:31:36 |
|
|
.Sh DESCRIPTION |
.Sh DESCRIPTION |
.Nm |
.Nm |
removes selected columns from the lines of a file. |
removes selected columns from the lines of a file. |
A column is defined as a single character in a line. |
|
Input is read from the standard input. |
Input is read from the standard input. |
Output is written to the standard output. |
Output is written to the standard output. |
.Pp |
.Pp |
|
|
column will be written. |
column will be written. |
Column numbering starts with one, not zero. |
Column numbering starts with one, not zero. |
.Pp |
.Pp |
Tab characters increment the column count to the next multiple of eight. |
Each character occupies the number of columns defined by |
Backspace characters decrement the column count by one. |
.Xr wcwidth 3 . |
|
Zero-width characters belong to the previous column rather |
|
than to the following column. |
|
If deletion of half of a double-width character is requested, |
|
its remaining half is replaced by a blank character. |
|
Non-printable characters are treated as if they had width 1. |
|
Each invalid byte is regarded as a non-printable character. |
|
.Pp |
|
Tab characters increment the input column count to the next multiple |
|
of eight. |
|
If they intersect or follow a deletion, they are expanded to blank |
|
characters such that the original alignment is preserved. |
|
.Pp |
|
Backspace characters decrement the column count by the width of the |
|
previous character. |
|
If they follow a character that is completely or partially deleted, |
|
they are deleted together with that character. |
|
If they follow a character that is partially deleted, |
|
they also suppress printing of the replacement blank character. |
|
.Pp |
|
For compatibility with |
|
.St -p1003.1-2008 |
|
.Xr fold 1 , |
|
if a double-width character is followed by two backspace characters |
|
instead of the usual one, both are regarded as belonging to that |
|
character, and the second one does not decrement the column count. |
|
.Sh ENVIRONMENT |
|
.Bl -tag -width LC_CTYPE |
|
.It Ev LC_CTYPE |
|
The character set |
|
.Xr locale 1 . |
|
It decides which sequences of bytes are treated as characters, |
|
and what their display width is. |
|
If unset or set to |
|
.Qq C , |
|
.Qq POSIX , |
|
or an unsupported value, each byte except tab and backspace is treated |
|
as a character of width 1. |
|
.El |
.Sh SEE ALSO |
.Sh SEE ALSO |
.Xr awk 1 , |
.Xr awk 1 , |
.Xr column 1 , |
.Xr column 1 , |
|
|
wrote the original version of |
wrote the original version of |
.Nm |
.Nm |
in November 1974. |
in November 1974. |
|
.Sh BUGS |
|
If two characters of different widths are followed by two backspace |
|
characters in a row, the column count is decremented twice by the |
|
width of the second character rather than by the sum of both widths. |
|
This is hardly a practical problem because not even backspace |
|
encoding in |
|
.Xr roff 7 |
|
style uses such double-backspace sequences. |