[Solved] Remove Line Breaks From WordPad Document
[Solved] Remove Line Breaks From WordPad Document
I have a 1700 KB document on my PC that was created elsewhere using WordPad. It has an rtf extension. The problem is that most of the lines have line breaks at about column 45. I think they're called line breaks anyway - they display in OOW as the backwards P. I'm using OO 4.0.1 and I remember there was a way to eliminate these line breaks while retaining the paragraph breaks, but I seem unable to get it to work using some old notes.
I open the document using OpenOffice, go into Edit, Find & Replace, enter \n in the Search For field, a space in Replace With field, click on More Options, put a check mark in Regular Expressions and click on the Find box. I always get 'Search key not found'. What might be the problem? Manually removing these breaks is something I do not have the time to do....
I did search the Survival Guide for 'delete line breaks' and 'remove line breaks', but got the message 'No suitable matches were found', which seems absurd.
I open the document using OpenOffice, go into Edit, Find & Replace, enter \n in the Search For field, a space in Replace With field, click on More Options, put a check mark in Regular Expressions and click on the Find box. I always get 'Search key not found'. What might be the problem? Manually removing these breaks is something I do not have the time to do....
I did search the Survival Guide for 'delete line breaks' and 'remove line breaks', but got the message 'No suitable matches were found', which seems absurd.
Last edited by Hagar Delest on Sat Aug 30, 2014 10:10 pm, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
OpenOffice 3.2 on Windows XP
Re: Remove Line Breaks From WordPad Document
Check that "Current selection" is not checked.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Re: Remove Line Breaks From WordPad Document
Thanks for the help, but Current Selection only is unchecked and grayed out. Even when I do select a paragraph of text containing line breaks and go through the same process (seeing that Current selection only is now checked), I still get search key not found.
Last edited by boweasel on Tue Aug 26, 2014 10:05 pm, edited 1 time in total.
OpenOffice 3.2 on Windows XP
Re: Remove Line Breaks From WordPad Document
Your method for replacing line breaks should work. Unfortunately, you have paragraph breaks, not line breaks. The backwards P is a paragraph break. A line break is a broken arrow symbol. If you remove all of the paragraph breaks, the whole document becomes one paragraph, possibly exceeding the 64K character limit for a paragraph. Since every line is ended with a paragraph break, you'll also have to come up with a scheme to retain paragraph breaks where they should be.
AOO 4.1.14 on Ubuntu MATE 22.04
Re: Remove Line Breaks From WordPad Document
Uhhhh.... sorry to be so dense about this, but I posted to this forum to get help for an OO problem that I was unable to solve myself. Saying that I 'have to come up with a scheme to retain paragraph breaks where they should be' puts the onus back squarely on me. If I had such a scheme there would've been no reason to post.Bill wrote: Since every line is ended with a paragraph break, you'll also have to come up with a scheme to retain paragraph breaks where they should be.
OpenOffice 3.2 on Windows XP
Re: Remove Line Breaks From WordPad Document
If there are double paragraph breaks(empty paragraphs) in places then you can change the empty Paragraphs into a token that does not occur in the file - I usually use %%%%, then use AltSearch to replace the remaining paragraph breaks with spaces, then change the %%%% back into paragraph breaks.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Re: Remove Line Breaks From WordPad Document
AltSearch has a built-in feature to combine paragraphs separated by empty paragraphs. The only problem I have with it is that it blows up if you select too much.
I've also used a little macro that condensed whatever was selected into a single paragraph. This is necessary in situations where there is no empty pargraph to mark where the paragraph breaks should be, but is rather labor-intensive, obviously.
There's no way that I know of to do this in OO out of the box.
I've also used a little macro that condensed whatever was selected into a single paragraph. This is necessary in situations where there is no empty pargraph to mark where the paragraph breaks should be, but is rather labor-intensive, obviously.
There's no way that I know of to do this in OO out of the box.
AOO4/LO5 • Linux • Fedora 23
Re: Remove Line Breaks From WordPad Document
Here's an attachment showing what part of the file looks like. Does this help?RoryOF wrote:If there are double paragraph breaks(empty paragraphs) in places then you can change the empty Paragraphs into a token that does not occur in the file - I usually use %%%%, then use AltSearch to replace the remaining paragraph breaks with spaces, then change the %%%% back into paragraph breaks.
OpenOffice 3.2 on Windows XP
Re: Remove Line Breaks From WordPad Document
Do as I said- probably no need to use AltSearch. Find ^$, Replace %%%% Regular expressions checked, Replace all. Then Find $, Replace <space>, Regular expressions checked, Replace all. Then Find %%%%, Replace \n, Regular expressions checked, Replace all. That should do it, but use a copy of the file in case of difficulty.
| Edit: if normal Find and Replace doesn't do it, then AltSearch will, using much the same sequence |
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
Re: Remove Line Breaks From WordPad Document
Thanks. This is REALLY close.... The only problem is that the original document had every paragraph separated by an empty line. There would be the paragraph break at the end of the text, followed by a line with the para break character in column 1. Following your suggestions eliminates that empty line between paragraphs.RoryOF wrote:Do as I said- probably no need to use AltSearch. Find ^$, Replace %%%% Regular expressions checked, Replace all. Then Find $, Replace <space>, Regular expressions checked, Replace all. Then Find %%%%, Replace \n, Regular expressions checked, Replace all. That should do it, but use a copy of the file in case of difficulty.
Edit: if normal Find and Replace doesn't do it, then AltSearch will, using much the same sequence
OpenOffice 3.2 on Windows XP
Re: Remove Line Breaks From WordPad Document
The final step is to replace all $ with \n\n, and someone can mark this [Solved], since I see no mechanism for doing so. And 'thank you' for your help and responses.
OpenOffice 3.2 on Windows XP