How do I remove a large number of hard returns from text that were pasted into my document (for example, from an email message)?

From Apache OpenOffice Wiki
< Documentation‎ | FAQ‎ | Writer‎ | FormattingText
Revision as of 02:26, 3 January 2009 by TJFrazier (Talk | contribs)

Jump to: navigation, search


How do I remove a large number of hard returns from text that were pasted into my document (for example, from an email message)?


Documentation checkarticle.png This article needs to be checked for accuracy and style.




Follow these steps:

  1. Select Edit -> Find & Replace.
  2. Near the bottom left of the dialog that appears, click on the box next to Regular Expressions.
  3. In the "Search For" field, type: ^$ This regular expression says to search for a paragraph marker '$' at the beginning of a paragraph - programmer terms for an empty paragraph.
  4. Click on the "Find" button.
  5. To replace the hard return with a space character, type a space in the "Replace With" field, then click the "Replace" button.
  6. To replace the hard return with nothing (remove the character), click the "Replace" button (without entering anything in the "Replace With" field).
  7. If you have many hard returns to replace, you can also use the "Replace All" button. It is wise to save your document prior to using this option, in case it behaves unexpectedly.

Note: Regular expressions do not appear to work in the "Replace" field.

Personal tools