I've tried this on OOO 3.0 on both Windows and Mac, so it should work generally.
Select Find and Replace Select More Options Select Regular Expressions Enter $ in the Search For field Click Find You will see the end of paragraph selected. You can replace it with any character or character combination except for non-printing characters. If you end the combination with \n, the end of paragraph character is retained. Otherwise, it is removed and the paragraph is merged with the next paragraph. I did not check to see which paragraph formats are retained. The help tells you that, to find and replace empty paragraphs, enter ^$ in the Find field. If you replace it with nothing, the empty paragraph is deleted. By the way, examining the format of the document as saved on disk tells you nothing about how it is represented in memory. John On Mon, Dec 8, 2008 at 7:32 PM, Harold Fuchs <[EMAIL PROTECTED] > wrote: > On 08/12/2008 22:02, Jerry Clancy wrote: > >> Invective aside, I have to agree with Elchanan. It can be extraordinarily >> effective at times when editing to seach for and replace instances of an end >> of paragraph marker (typically, a carraige return/line feed pair) with or >> without surrounding characters. While one responder indicated that there was >> no such thing, I beg to differ. Surely Writer uses some internal >> representation of "paragraph end". Not every word processor allows these >> seaches in spite of their usefulness. Like Elchanan, I never found a way to >> do it either in Writer in spite of spending quite a bit of time once trying >> to find out how. To this day I still find myslef going back to good old >> DOS-based XyWrite to do some of these things. >> >> Your average user, I'd bet, hasn't a clue to what a "regex" is and, >> furthermore, doesn't care. All they want to do in this case is have a way of >> representing an "end of paragraph" (or line break, for that matter) in a >> Writer search. >> >> Jerry >> >> >> <snip> > > Firstly, paragraph marks and line-breaks (what you get with Shift-Enter) > *do not exist* as single characters in Writer documents. You can see this by > doing the following (this works on Windows; a slightly different procedure > *might* be needed on *nix or Mac): > 1. Create a Writer document with a few paragraphs and line-breaks and save > it as, say "paragraphs.odt". > 2. Rename the file to "paragraphs.zip". > 3. Open this file with Winzip or equivalent. > 4. Extract the file "content.xml" from the (Zip) archive into a *text* > editor. > > You will see that the text of normal paragraphs is prefixed by an XML > "tag": <text:p text:style-name="Standard"> and terminated by a tag: > </text:p> whereas a "Shift-Enter" paragraph starts the same but is > terminated by the tag: <text:line-break/>. > > Also, if you include characters like "<" and ">" they are replaced in the > XML file by their XML multi-character equivalents "<" and ">" > respectively, so even searching for those is not as straightforward as it > would seem at first sight. > > Secondly, I quote from OOo's Help: "You can only search for regular > expressions within the same paragraph. That is, you cannot search for one > term in a paragraph and a different term in the next paragraph." > > On the other hand, it would be really good if OOo could search for any > "artefact" it can construct - styles, fonts, etc. etc. > > -- > Harold Fuchs > London, England > Please reply *only* to [email protected] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
