TR - Truncate
Truncates lines.
Syntax
TR{n}/string{/{p{-q}}}
or
TRm-k/string{/{p{-q}}}
or
TRm,n/string{/{p{-q}}}
Syntax Elements
n The number of lines to truncate, beginning with the current line. If n is not specified, it defaults to the current line.
m -k Specifies line m to line k.
m ,n Specifies n lines, starting at line m.
/ A delimiter separating the different parts of the command. It can be any nonnumeric character (except a blank or minus sign) that does not appear in string. The delimiter terminating string is necessary only if further parameters follow the string specification, or if trailing blanks are to be included as part of the string.
Note that using the colon (:) as a delimiter anchors the search to the starting column (see Column Dependent Matching).
string A character string that determines where the line is to be truncated. Each line in the specified range is scanned for this text; if a match is found, the line is truncated at the beginning of the matching text.
The caret character (^) can be used within the search string to match any single character (see Wildcard Character for more details).
p Specifies a starting column (see Column Dependent Matching).
q Specifies an ending column. If omitted, defaults to p. Ignored if less than p,
Operation
If you specify a number or range of lines, all truncated lines are listed. Note that the line pointer is positioned at the last line in the range, and therefore might not be located at the last line listed.
Example
|
|