Hi, @tsquared, @ekopalypse, @alan-kilborn, @terry-r and All,
Ah, OK : You’ve got some trouble because of the huge file size :-((
So, instead of trying to bookmark some lines and select bunches of lines, here is a method which just get rid of any single unwanted line !. May be, it’ll be quicker !
First, some assumptions :
No pure blank lines or lines with blank characters only occur in your file ( Important )
The blocks to keep start with the line START BREAK THROUGH @ WT, with that exact case, possibly preceded with some blank characters
The blocks to keep end with the line END BREAK THROUGH @ WT, with that exact case, possibly preceded with some blank characters
You’ll have to find out a dummy character, used as a temporary symbol, for correct execution of the different regexes. To that purpose, open the Find dialog and type in any single symbol, in the Find what: zone. If a click, on the Count button, produces the message Count : 0 match, this symbol can be used :-) As for me, I chose the # symbol
Let’s begin :
First, run the Edit > Line Operations > Remove Empty Lines ( Containing Blank characters ) option
Add a pure blank line on the very beginning of your file
Place the caret ( cursor ) on that empty line, beginning your file ( Important )
Perform this first regex S/R, which adds a # char at the end of the Start header line and at the end of all lines to be kept :
SEARCH (?-is)(?:^(\h*START BREAK THROUGH @ WT)(\R)|\G)((?:(?!END BREAK THROUGH @ WT).)+)(\R)
REPLACE (?1\1#\2)\3#\4
Then, perform this second regex S/R, which simply add a # symbol at the end of the End header line
SEARCH (?-i)^\h*END BREAK THROUGH @ WT
REPLACE $0#
Finally, run this third regex S/R, which should delete any line which does not end with the # symbol, as well as the # symbol, itself, on lines to be kept
SEARCH (?-s)^.+[^#\r\n]\R|#
REPLACE Leave EMPTY
Hope this helps you to modify your file more easily !
Best Regards,
guy038
P.S. :
I now realize that, after execution of the third regex S/R, any line START BREAK THROUGH @ WT is preceded with a line END BREAK THROUGH @ WT, so may be this End header line is useless for correct identification of the different sections
In that case, just don’t run the second regex S/R and all the End header lines will be deleted as well ;-))