Most people know about search and replace, but fewer know that you can search & replace weird stuff like paragraph marks. This is a life-saver if you want to get rid of fixed line-breaks in text that you’ve copied and pasted into Word. It happens a lot with emails, but also with text copied from pdfs – resulting in a 25 page document that could easily be unwrapped into 4 pages. You can’t see the paragraph marks unless you press the ‘show non-printing characters’ button (see left), but if you’ve got lines that won’t unwrap, they’re probably to blame.
Tip: If you’re faced with a load of annoying paragraph breaks on every line of pasted text
- Go to Edit>Replace (or Press Ctrl+H/Mac: ⌃⌘+H)
- Select the advanced options
- Press the ‘special’ menu button (see image below)
- Select ‘Paragraph Mark’
- This will put the sign for ^p in the ‘Find’ box
- In the ‘Replace’ box, press Spacebar once (i.e. so you’re replacing the paragraph mark with a space)†
- Select ‘replace all’
And there you are – all back into normal text again. You can of course just type ^p instead of selecting the special menu – but it’s worth seeing what else you can search for to replace.
With emails, once you’ve done this, you may still need to get rid of the chevrons (>) that sometimes get put on the beginning of every line of quoted text.
- Go to Edit>Replace
- Type > in the ‘Find’ box
- In the ‘replace’ box, press Spacebar once – i.e. you’re going to replace each > with a space
- Select ‘replace all’
Result: one clean piece of text. Oh I nearly forgot: you’ll need something to practise on, here you are:
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
>The quick brown fox jumps over the lazy dog
† I originally had ‘put nothing in the replace box’ but two people have suggested that it’s better with a space, and I find this too, now, so I’ve changed it.
I really appreciated this article, as it taught me something I’ve been wondering about for a while. I used this technique to fix the hard wrapping that occurs when you copy a pdf text into word.
A tiny change to the above recipe that is needed to improve this case, is to add a space in the “Replace with” field. That prevents the joining of words that will occur otherwise.
Thanks for a great article! Much appreciated!
Thanks for the appreciative comment.
It makes sense to add a space, so I’m wondering why I (deliberately – I remember) left that step out. I think I must have had a case where the deletion of a paragraph mark resulted in a space anyway, but that doesn’t sound right.
Hey, Could you please edit the post above. It is really worth inserting Space instead of ^p 🙂
YOU ROCK !!! Thank you!!!
Thank you!
you saved me thank you very much