by Mofi » Fri May 09, 2008 2:37 am
That can be done with a simple macro. Make sure you have only the 2 files open and file 2 with the lines which should be deleted in file 1 has the focus when you run the macro. The macro is written for DOS files. If you run it on UNIX files without automatical convert of the UNIX line endings to DOS line endings replace all 3 ^p by ^n in the macro.
The macro property Continue if a Find with Replace not found or Continue if search string not found must be checked for this macro.
InsertMode
ColumnModeOff
HexOff
UnixReOff
Bottom
IfColNum 1
Else
"
"
EndIf
Top
TrimTrailingSpaces
Loop
Find "^p^p"
Replace All "^p"
IfNotFound
ExitLoop
EndIf
EndLoop
SelectAll
Clipboard 9
Copy
CloseFile NoSave
Top
Paste
ClearClipboard
Clipboard 0
"#
"
Bottom
IfColNum 1
Else
"
"
EndIf
Top
Loop
IfCharIs "#"
DeleteLine
ExitLoop
EndIf
SelectLine
Find "^s"
Replace All ""
EndLoop
Add UnixReOn or PerlReOn (v12+ of UE) at the end of the macro if you do not use UltraEdit style regular expressions by default - see search configuration. Macro command UnixReOff sets the regular expression option to UltraEdit style.