OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Regular expression for carriage return

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
yakalskovich
Newbie
Newbie


Joined: 14 Aug 2004
Posts: 2
Location: Munich, Germany

PostPosted: Sat Aug 14, 2004 8:53 am    Post subject: Regular expression for carriage return Reply with quote

Embarassed

I cannot find the regular expression for a normal hard carriage return (as opposed to newline) anywhere. You know, the one that used to be "^p" in MS Office?

There is a nice function in the regular expression list to replace empty paragraphs. There is also an issue from 2003 (#11982), declared closed, where somebody asks for the expression and is told that it exists, the list of regular expressions in the help file simply isn't updated. They totally fail to mention what it *is*, actually.

I use the German localised version, but I don't think that means the help file would be much different, would it? Using regular expressions, one can (according to my help file) do the following three things:
a) delete empty paragraphs
b) convert line feeds to carriage returns
c) take out hard carriage returns in the middle of sentences that occur in some document types (text taken from MS Outlook comes to mind, for example).

That is very thoroughly thought through, but unfortunately takes some decisions away from us users that we actually need to take. No kind of thorough thinking and second-guessing can cover all eventualities. I need to replace a hard carriage return with *two* of them at times in order to feed a formerly decently formatted text into a clunky old HTML mailing list tool (derived of CIAO, actually, if you've met that), and for that to look prope in text-only, I have to have empty paragraphs. Otherwise, it all sticks together and looks even clunkier.

It is what I need to do. Full stop. Please don't tell me that I need to update CIAO, or switch to another system, or anything of that sort. On the ability of *inserting* empty paragraphs rests the question of whether I can suggest to kick out MS Office where I work and replace it with OOo.

Why can't it be "\r" as in so many other systems? I can deal with the list of regular expressions, and will demand the same of my users - but I *can't* do it when we don't know what the simple, open regular expression for a carriage return is!

Thanks a lot in advance,

Yakkie
Back to top
View user's profile Send private message
Iannz
OOo Advocate
OOo Advocate


Joined: 14 Feb 2004
Posts: 494
Location: Christchurch, New Zealand

PostPosted: Sat Aug 14, 2004 3:25 pm    Post subject: Reply with quote

For regular expressions the end of a paragraph is symbolised by $.
The problem is that for regular expressions Writer searches within a paragraph at a time so you can't search over more than one paragraph. E.g. searching for $$$ doesn't work.

To get around this and some other limitations I have written a macro which is in the document IannzFindReplace.sxw available from the URL in the signature.
_________________
Cheers, Ian

http://wiki.services.openoffice.org/wiki/Extensions_development_basic a wiki about writing OpenOffice.org extensions.
Back to top
View user's profile Send private message
yakalskovich
Newbie
Newbie


Joined: 14 Aug 2004
Posts: 2
Location: Munich, Germany

PostPosted: Sat Aug 14, 2004 8:18 pm    Post subject: Reply with quote

Thank you - I will try that! It is a curious way of searching for things OOo has, then, one paragraph at a time.

- Yakki
Back to top
View user's profile Send private message
frazelle09
OOo Enthusiast
OOo Enthusiast


Joined: 24 May 2004
Posts: 142
Location: Mexicali, Baja California

PostPosted: Sun Jan 24, 2010 7:17 pm    Post subject: Reply with quote

lannz!

You be the man! Just tried your FindandReplace and wow! it works just great to replace all those nasty hard returns.

Thanks a million -- i've got some 25 pdfs to turn into odt files and this will help tremendously.

Have a great evening! Smile
_________________
Now using 3.2.1 on 4 PCLinuxOS 2010 boxes (two are laptops).

"The earth is one country and mankind its citizens."
Bahá'u'lláh

"La tierra es un sólo país y la humanidad sus ciudadanos."
Bahá'u'lláh
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Robert Tucker
Moderator
Moderator


Joined: 16 Aug 2004
Posts: 3407
Location: Manchester UK

PostPosted: Mon Jan 25, 2010 4:09 am    Post subject: Reply with quote

frazelle09 wrote:
i've got some 25 pdfs to turn into odt files


You may want to install AltSearch and also have a look at the macro here:

http://www.oooforum.org/forum/viewtopic.phtml?t=6429
_________________
OpenOffice 4.0.0 and LibreOffice 4.x.x on Fedora 20, Ubuntu 13.10, Windows 8.1 Preview (Triple Boot)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group