Delete line
-
Hi, I’ve one txt file like this:
Title: Fred Montana
Date: 31 Avril 2017Title: Doors
Date: 22 may 2015etc…
I want delete all lines with Date: …
I I’ve try with search & replaced with extended mode and entry Date: .* but not work…
How to del all line with text Date: … ?? -
Hello, @renso-petrulli,
Very easy, indeed ! You should have tried the Regular expression mode, instead :-))
SEARCH
(?-i)^Date.*\R?REPLACE
Leave EMPTYNotes :
-
The first part
(?-i)forces the search to be sensitive to case. If the word Date may have any case, change for(?i) -
Then, the
^symbol is an zero-length assertion, which means beginning of Line -
The part
Date.*represents the word Date, followed by any range of characters, even empty -
Now, the
\Rsyntax stands for any line-break ( End of Line characters ) -
Finally, the
?quantifier, equivalent to{0,1}means that the line-break may be present or NOT ( case of a last line Date…, without any line-break, at its end ! ) -
As the replacement zone is empty, the entire current line is deleted
Note the difference with the following S/R
SEARCH
(?-i)^Date.*REPLACE
Leave EMPTYIn that case, any line, beginning with the word Date, is replaced by a pure blank line
Best Regards,
guy038
-
-
Yes! Thank you very much!
Regards. RP
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login