« Using Scenarios in OpenOffice Calc spreadsheets to figure out what to do | Main | Follow me on twitter! (updated link to new ID) »

November 02, 2009

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341cdb1753ef0115712c2db5970c

Listed below are links to weblogs that reference Searching and replacing paragraph returns (carriage returns), tabs, and other special characters in OpenOffice Writer:

Comments

pond

One thing to look out for using the ^$ string: if you have different paragraph styles on either side of the empty paragraph, one of those styles will become the other.

I usually Replace All with any long document, then scroll through and look for any anomolies especially where I have headings or blockquotes.

Solveig

Good point pond; different adjacent paragraph styles will be combined.

Shantanu Oak

Is there any way to make it faster? It took a lot of time when I tried it on a lengthy document.

Solveig

Hi Shantanu,

Just the usual; close all other programs and processes.

Sérgio Luiz Araújo Silva

How change 2 empty lines to one

bev ashley

Is there any way to remove the soft carriage returns for only selected areas of a document? The intent is obviously to enable a line-length change to text containing soft carriage returns while leaving other portions of the text file untouched. It seems like the search \n or $ options are an all-or-nothing method.

Pico does it a paragraph at a time with control-j. That's what I'd like!

solveig

Hi Bev,

You can select nonconsecutive parts of the document (Ctrl select) and then apply the s/r to only selection. You might also be able to do it using more sophisticated regular expressions. Press F1 for the help and search for regular expressions; there's a bunch of stuff in there.

bev ashley

I assume control-select means control-select-with-the-mouse, right? Thanks, I'll try that next time I have one of the nasty text files to fix. I'm surprised that there isn't a one-step way to do it -- even WordStar had that facility!

Drew Trott

There seem to be a lot of unexpected and unfortunate behaviors in this feature.

First of all, it should be possible to select a whole paragraph *except* for the last carriage return and use Replace All to eliminate all the other carriage returns. This would speed the process up considerably. (I don't think the user above was worried about an overloaded processor.) But I can't find any way to do it. No matter what I select it doesn't behave as I expect or want it to.

It should be possible (as the user above asked) to replace two empty lines with one. Nope. If I put ^$^$ in the search box, I get "Search key not found." And I get the same result with every variation I can think of, i.e., $$, ^$$, and $^$.

Another available strategy should be to (1) globally replace double returns with a unique string (like DOUBLERETURN); (2) globally replace all remaining (single) returns with a space (or nothing); and (3) globally replace DOUBLERETURN with two returns. Voila, you've stripped out all the returns except the ones you want, at the ends of paragraphs. But I see no way to do this with OO because it apparently can't be made to find a string of returns.

I've had to clean up scanned text where there were random numbers of extra returns, maybe as many as four or five in a row. The quickest way I know to do it is to globally replace three returns with two (or two with one, depending on the intended end result) and repeat this process until the search string is no longer found. But again, no go in OO.

This is the kind of thing that forces me back sorrowfully to Word. I'd love to ditch it, especially now that MS has forced the worst "upgrade" in recent history down my employer (and thus my) throat. But OO just doesn't seem ready for prime time, at least for power users.

Jim Cole

I might have missed it...but in doing my search and replace functions I often find that I need to replace "something" BEFORE a carriage return, with nothing. As an example often, I find that there are unwanted spaces before a carriage return, and when using a text file which will be subsequently imported into a database those spaces are problems. I have been looking now for about an hour for how to search for the combination of "space" and "carriage return" and not having luck. Perhaps the combination of hex characters representing the space and carriage return would work? Haven't tried that yet. Finding the "$" for searching for carriage returns was great...but after that I have been stymied.

Same comment as Drew above...this is the kind of thing that sorrowfully forces me back to Word, as it is easily done with a caret and some other letters and spaces, but OO is not making it intuitively difficult let alone easy, for me to do this.

Pablo

Yes, the power users need work to much with all forms of characters. To clean docs that comming from other sides and containing spaces before a carriage return when is not necesary; well, I hope see this soon in OO...I will not to use Word for ever.

Bill

A Google search for this problem lead me here. This is an annoying problem - finding multiple paragraph marks (ie $$ etc). After reading the discussion I resorted to a desperate, un-elegant, but successful solution. With regular expressions enabled, search for $ (one paragraph mark) and globally replace this with XXXX (four Xs); repeat this until "Search string not found". Now the solution is painful, but effective: search for XXXXXXXX and globally replace with \n. Finally, search for XXXX and globally replace with \n. Obviously you can use something other than XXXX. As I said, painful, but effective.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

GetOpenOffice Consulting

Get Book Resources

Search This Blog