DE - Delete
Deletes lines from an item. String deletion is not supported; to delete a string from within a line, use the R (Replace) command.
Syntax
DE{n}{/string{/p{-q}}}
or
DEm-k{/string{/p{-q}}}
or
DEm,n{/string{/p{-q}}}
Syntax Elements
n The number of lines to process, beginning with the current line. If n is omitted, it defaults to the current line (but see string below).
m -kSpecifies line m through line k.
m ,nSpecifies n lines, starting at line m.
/ A delimiter separating the syntax elements. It can be any nonnumeric character (except a blank or minus sign) that does not appear in string. The following characters have special meanings when used as delimiters:
# (hash) Negates the search; deletes lines that do not contain the specified string(s).
: (colon) Anchors the search to the starting column (see Column Dependent Matching).
string A search string. Only lines containing this string will be deleted (but see the p and q parameters below). Lines that are deleted are listed and the line pointer is positioned at the last line in the specified range.
Note that, if no lines are specified, the next line containing string is located and that line is deleted.
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.
Example 1
|
|
Example 2
|
|
Example 3
|
|