Remove CR LF for all lines that are not followed by a specific number

Posted by Kjeldsen on Super User See other posts from Super User or by Kjeldsen
Published on 2014-08-19T09:28:40Z Indexed on 2014/08/19 10:23 UTC
Read the original article Hit count: 240

Filed under:
|

I have 14000+ lines of a database, that I want to edit with Notepad++. All these lines should start with 1000 and I therefore want to delete CR LF at the end of those lines that are not followed by 1000.

Eg.
1000 16 04000 CRLF
sdfsdf 15 sdf de 05550 CRLF
1000 16 04000 CRLF
1000 16 04000 CRLF
5. sdkfd dksds 16 0555 CRLF
10/10/14 sdfsdf CRLF

should after find and replace look like
1000 16 04000 sdfsdf 15 sdf de 05550 CRLF
1000 16 04000 CRLF
1000 16 04000 5. sdkfd dksds 16 0555 10 sdfsdf CRLF

I have tried with find what: \r\n([^1000]) Replace with _\1
However, this doesn't seem to remove lines starting with a number (like 5. or 10/10/14). Is it possible to make just one RegEx to find and remove all line breaks that isn't followed by 1000?

"_" indicating a "space"

© Super User or respective owner

Related posts about notepad++

Related posts about find-and-replace