Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a text file where I'd like to remove every second carriage return starting with line 2. So the carriage return should be removed in lines 2, 4, 6, etc.

The carriage return can is identifiable in Notepad++ with the LF character.

I know that I can find it with \n in advanced mode.

Any ideas?

Thanks in advance!

share|improve this question
add comment

1 Answer

Use Regular Expression mode. You will search for a carriage return (Windows uses \r\n as a carriage return), some text, and then another carriage return. The replace with will give you back only the stuff in the parenthesis. Make sure you run "Replace all" as I did not test on replacing one at a time.

Find what:     (\r\n.*)\r\n
Replace with:  \1
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.