This is no problem using a macro. The macro is a simplified version of what I have posted at
How do I remove duplicate lines?The macro first inserts at start of every non blank line the string
#MOFI_RULES# as marker string for start of the line.
Then a loop is executed. Inside the loop a Perl regular expression search is used to find the next line starting with the marker string
#MOFI_RULES# followed by up to 60 characters except line terminating characters. If such a string could not be found anymore from current cursor position to bottom of the file, the loop is exited.
If a string is found, it is copied to clipboard 9 and the cursor is moved to the start of the next line.
A simple, non regular expression replace all command is now used to insert your marker string
<<<>>> at start of all lines starting also with the marker string
#MOFI_RULES# and with the same up to 60 characters as the line above the cursor. The marker string
#MOFI_RULES# prevents this replace command for finding the up to 60 characters anywhere else than at start of a line. A regular expression replace can't be used here because ^c (clipboard content) is only supported by the UltraEdit regular expression engine and the clipboard content would be interpreted also as UltraEdit regular expression string if it would contain UltraEdit regular expression characters. That's the reason why the search and replace all command can't be a regular expression replace.
Your marker string
<<<>>> inserted at start of lines with the first 60 characters duplicate to another line prevents such lines for being taken into account on further searches.
Finally the marker string
#MOFI_RULES# is removed from all lines and Windows clipboard is activated again.
The macro property
Continue if search string not found must be checked for this macro.
InsertMode
ColumnModeOff
HexOff
PerlReOn
Bottom
IfColNumGt 1
"
"
EndIf
Top
Find RegExp "^([^\r\n])"
Replace All "#MOFI_RULES#\1"
Clipboard 9
Loop
Find RegExp "^#MOFI_RULES#.{1,60}"
IfNotFound
ExitLoop
EndIf
Copy
Key DOWN ARROW
Key HOME
Find MatchCase "^c"
Replace All "<<<>>>^c"
IfFound
Find MatchCase "<<<>>>#MOFI_RULES#"
Replace All "<<<>>>"
EndIfEndLoop
Top
Find MatchCase "#MOFI_RULES#"
Replace All ""
ClearClipboard
Clipboard 0
The red marked code is only needed if the file has also lines with less than 60 characters and those lines start with the same characters as another line with more characters which is located above. For example for a file content like the following
aaaa 1111 2222 3333 4444bbbb 1111 2222 3333 4444
aaaa 1111 2222cccc 1111 2222 3333 4444
dddd 1111 2222 3333 4444
aaaa 1111 2222 3333 4444aaaa 1111 2222the macro above without the red marked code would produce
aaaa 1111 2222 3333 4444
bbbb 1111 2222 3333 4444
aaaa 1111 2222
cccc 1111 2222 3333 4444
dddd 1111 2222 3333 4444
<<<>>>
<<<>>>aaaa 1111 2222 3333 4444
<<<>>>aaaa 1111 2222
As you can see the 6th line is marked twice as duplicate which is not 100% correct. The red marked code removes the marker string
#MOFI_RULES# from lines already marked with
<<<>>> to prevent marking such lines more than once. If your file does not contain lines with less than 60 characters you can omit the red marked code which makes the macro faster.