,
address2]]G
Same as g
, except that a newline and the the hold space are pasted to the end of the pattern space instead of overwriting it. The Example shows a simple way to "cut and paste" lines.
This script collects all lines containing the word Item: and moves them after a place marker later in the file. The original Item: lines are deleted.
/Item:/{ H d } /Summary of items:/G