In Word
- Press Ctrl + H to open Find and Replace.
- Click More >>, then Special, then Paragraph Mark. This enters
^p. - Leave Replace with as a single space.
- Click Replace All.
In Excel
- Select the cells and press Ctrl + H.
- Click in Find what and press Ctrl + J. A tiny dot appears.
- Type a space in Replace with and click Replace All.
Or use a formula in a helper column:
=SUBSTITUTE(A1,CHAR(10)," ")
In any editor with regular expressions
Turn on “regex” in Find and Replace, search for the pattern below and replace it with a space:
\r?\n
Tip: To keep paragraphs but fix broken lines, replace a single line break and leave blank lines alone. Search for two breaks first, swap them for a placeholder, then restore them afterwards.
Questions
What is the difference between a line break and a paragraph mark?
In Word, Shift + Enter adds a line break (^l), Enter adds a paragraph mark (^p). Search for the one you actually have.
Can I remove empty lines too?
Yes. Replace two paragraph marks (^p^p) with one (^p) and repeat until nothing is found.