Reputation: 21
I've got a string of data that have random CRLF inserted in the lines which I need to remove and proper CRLF ending the data which I need to keep.
I've tried using Notepad++ regex trying to replace the following with empty: [^NULL]\r\n
However, it does not remove the inserted CRLFs. Any thoughts on how best to use this in Notepad++?
Upvotes: 1
Views: 487
Reputation: 91518
This will replace every linebreak that is not preceeded by "NULL".
(?<!NULL)\R
# a space OR any thing you want that will replace the linebreakExplanation:
(?<! # negative lookbehind, make sure we haven't before:
NULL # literally NULL
) # end lookbehind
\R # any kind of linebreak (i.e. \r or \n or \r\n)
Screenshot (before):
Screenshot (after):
Upvotes: 1
Reputation: 25793
Not sure if this is exactly what you mean, but you can use the Extended
search mode to match \r\n
specifically.
Find what: NULL\r\n
Replace with:
Upvotes: 0