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.

For example, this:

This text has been splitted
in lines, and it's longer than
3200 words, so it would be great
to find and replace line breaks
like these.
share|improve this question
Hmm, in VI it would be just typing 4J –  Bernhard Dec 12 '12 at 9:11
Did you try to do an Extended replace of '\n' with '' ? –  Ofiris Dec 12 '12 at 9:11

2 Answers 2

up vote 64 down vote accepted
  1. Highlight the lines you want to join (or use Ctrl + A to select everything)
  2. Choose Edit → Line Operations → Join Lines from the menu or press Ctrl + J.

It will put in spaces automatically if necessary to prevent words from getting stuck together

share|improve this answer
Thanks but i has to be done one by one, is there a way to do this for the entire document? –  Gabriel Dec 12 '12 at 9:28
I get it now, I selected the entire document and works exactly like I needed! –  Gabriel Dec 12 '12 at 9:29
CTRL J is the shortcut –  user640378 Jan 15 '14 at 15:46
OMG, thanks a lot... didnt knew about that - would have saved me a lot of time ;) –  Sagive SEO Jun 29 at 11:37


In Search Mode pick Extended

Find - \r\n Replace - leave it empty.

share|improve this answer
I believe it needs to be \r\n since this is for Windows. –  James Dec 12 '12 at 9:25
It should be \r\n and the replace field should contain one space character. –  amiregelz Dec 12 '12 at 9:29
@James, Thanks, fixed. –  Ofiris May 31 '13 at 11:33

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.