Difference between revisions of "Documentation/FAQ/Writer/FormattingText/How do I remove a large number of hard returns from text that were pasted into my document?"

From Apache OpenOffice Wiki
Jump to: navigation, search
(checked under 3.0)
(4 intermediate revisions by 3 users not shown)
Line 4: Line 4:
 
'''How do I remove a large number of hard returns from text that were pasted into my document (for example, from an email message)?'''
 
'''How do I remove a large number of hard returns from text that were pasted into my document (for example, from an email message)?'''
 
<section end=question/>
 
<section end=question/>
 
<div>
 
<span style="border:1px solid #CCAA77; background-color: #FFFFAA; padding: 4px; text-align: left; margin-bottom: 20px; white-space: nowrap;">
 
[[image:documentation_checkarticle.png|40px]] This article needs to be checked for accuracy and style.
 
</span>
 
</div>
 
 
[[Category: Documentation/NeedsRework]]
 
{{Documentation/CheckedAccuracy|[[User:TJFrazier|TJ]] 03:26, 3 January 2009 (CET)}}
 
 
 
  
  
Line 20: Line 9:
 
Follow these steps:  
 
Follow these steps:  
  
# Select '''Edit -> Find &amp; Replace'''.  
+
# Select '''Edit -> Find &amp; Replace'''.
# Near the bottom left of the dialog that appears, click on the box next to '''Regular Expressions'''.
+
# Click on the '''More Options''' button to open the full dialog.  
# In the "'''Search F'''or" field, type: ^$ This regular expression says to search for a paragraph marker '$' at the beginning of a paragraph - programmer terms for an empty paragraph.  
+
# Near the bottom left of the dialog, select the '''Regular Expressions''' check box.
# Click on the "'''Find'''" button.  
+
# In the '''Search for''' field, type:<br> ^$<br>This regular expression says to search for a paragraph marker '$' at the beginning of a paragraph - programmer terms for an empty paragraph. <b>^$</b> finds empty paragraphs, i.e., a carriage return with no text, i.e., the second of two consecutive returns with no intervening text. Use <br> $<br> (without the caret) to find hard returns, common in plain text documents, emails, etc.
# To replace the hard return with a space character, type a space in the "'''Replace With'''" field, then click the "'''Replace'''" button.  
+
# Click on the '''Find''' button.  
# To replace the hard return with nothing (remove the character), click the "'''Replace'''" button (without entering anything in the "Replace With" field).  
+
# To replace the hard return with a space character, type a space in the '''Replace with''' field, then click the '''Replace''' button.  
# 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.  
+
# To replace the hard return with nothing (remove the character), click the '''Replace''' button (without entering anything in the '''Replace with''' field).  
 +
# 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.
 
 
<section end=answer/>
 
<section end=answer/>
  
 
[[Category:Documentation/FAQ/Writer/FormattingText]]
 
[[Category:Documentation/FAQ/Writer/FormattingText]]

Revision as of 13:02, 1 July 2018


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



Follow these steps:

  1. Select Edit -> Find & Replace.
  2. Click on the More Options button to open the full dialog.
  3. Near the bottom left of the dialog, select the Regular Expressions check box.
  4. 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. ^$ finds empty paragraphs, i.e., a carriage return with no text, i.e., the second of two consecutive returns with no intervening text. Use
    $
    (without the caret) to find hard returns, common in plain text documents, emails, etc.
  5. Click on the Find button.
  6. To replace the hard return with a space character, type a space in the Replace with field, then click the Replace button.
  7. To replace the hard return with nothing (remove the character), click the Replace button (without entering anything in the Replace with field).
  8. 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.


Personal tools