Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 2 down vote accepted

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

Your Answer


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.