I have an txt file with 65K lines. and not all are correct aligned.
So I need to replace the lines not ending with ;Yes or ;No with an space
;Yes
;No
Tried
^{^;Yes|^;No}$
Select Perl while enabling Regular Expressions. Put this in Find What:
Perl
Find What
(?m)^.*$(?<!;Yes|;No)
Put a space character in Replace with input field.
Replace with
Breakdown:
(?m)
^.*$
(?<!
|
)
Live demo
Try the following find and replace in regex mode:
Find:
^(?!.*(Yes|No);$).*$
Replace:
(space)
Demo
This answer assumes that UltraEdit supports lookarounds. If not, then it won't work, and we would need an alternative approach.
Copyright © 2021 Jogjafile Inc.
Select
Perlwhile enabling Regular Expressions. Put this inFind What:Put a space character in
Replace withinput field.Breakdown:
(?m)Enable multline flag^.*$Match a whole line(?<!Start of a negative lookbehind;YesLast 4 characters shouldn't be ;Yes|Or;No;No)End of negative lookbehindLive demo