Search This Blog

Wednesday 17 March 2010

Remove carriage returns at ends of lines

From http://word.mvps.org/FAQs/General/DeleteParaMarksAtEndOfLines.htm

If you have pasted a file into Word in which each line ends with a paragraph mark and each paragraph ends with two or more paragraph marks:
1. On the Edit Menu, choose Replace.
2. In the Find What box, enter:
([!^13])(^13)([!^13])
In the Replace With box, enter:
\1 \3
Click the More.. button, and check "Use Wildcards".
Click Replace All and click OK when Word tells you it has done the replacement.
This will remove any paragraph marks that are at the end of a line but within a paragraph.
3. Now, in the Find What box, enter:
^13{2,}
In the Replace With box, enter:
^p
Click Replace All and click OK when Word tells you it has done the replacement.
This will remove multiple consecutive paragraph marks, so that each paragraph ends with just one paragraph mark, as it should.
Note that the Use Wildcards setting is sticky, so if you subsequently do another Find and Replace during the same Word session, you have to remember to switch it off again, if appropriate.