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
1  
Did you try to do an Extended replace of '\n' with '' ? –  Ofiris Dec 12 '12 at 9:11
    
If you are looking to compose something like a URL from putting the URI parameters on multiple lines, then this answer is a bit more helpful: stackoverflow.com/a/13990281/501113 –  chaotic3quilibrium Aug 19 at 15:37

3 Answers 3

up vote 67 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
2  
I get it now, I selected the entire document and works exactly like I needed! –  Gabriel Dec 12 '12 at 9:29
4  
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

CTRL+H

In Search Mode pick Extended

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

share|improve this answer
3  
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

For me, using Win 7, I had to use

\r

in the Find box and type in <space> in the Replace box so that there is a single space between the last word of the current line and the first word of the next line.

share|improve this answer
    
Did you mean \n –  Prasanna Aug 28 at 5:59
    
No, I mean \r. \n does nothing on my system. –  Alan M Aug 31 at 22:53

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.