|
Post by Stefan on Mar 14, 2022 8:49:20 GMT -5
While perusing the available commands, I happened upon the DROP and KEEP commands.
While I've yet to find an use-case for either DROP or KEEP, I think that the functional description of KEEP has been incorrectly copied from DROP. I'm pretty sure that...
"When such a block is ‘kept', one or more lines are deleted from the block."
...should probably not have the word 'deleted' in it.
|
|
|
Post by George on Mar 14, 2022 13:36:40 GMT -5
Stefan: No, both DROP and KEEP actually remove lines. Yes, I realize the confusion.
It's basically two ways of specifying how to choose the lines being deleted.
DROP specifies the lines to be 'dropped', all others are retained.
KEEP specifies the lines to be 'kept', all others are deleted.
But both commands work by deleting lines. They are sort of mirror image of each other.
E.g. you can TAG a bunch of lines, which appear in scattered groupings (i.e. non-tag lines in between. Say you want to keep only 1 line from each group.
KEEP :tagname FIRST | LAST
would do so, keeping only the 1st or last line.
They're actually very powerful commands once you grasp what they're capable of.
George
|
|