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

find and replace function

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


Joined: 15 Jun 2008
Posts: 34

PostPosted: Thu Dec 18, 2008 8:13 am    Post subject: find and replace function Reply with quote

I have a document where I want to modify certain dates. For instance, I have "10 AD" which I want to modify to "A.D. 10".
Easy to do, but is there a way to use find and replace to modify all the dates I have that are like that? Not only "10 AD" but "3 AD", "6 AD", etc.
In other words, is there a universal place holder that find and replace will recognize and work with?
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 9183
Location: Lexinton, Kentucky, USA

PostPosted: Thu Dec 18, 2008 12:20 pm    Post subject: Reply with quote

Search for ([:digit:]*).*
Replace with A.D. $1
Check Regular Expressions.

I believe this requires v2.4.1 or higher.


Last edited by JohnV on Fri Dec 19, 2008 7:48 am; edited 1 time in total
Back to top
View user's profile Send private message
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Thu Dec 18, 2008 1:33 pm    Post subject: Reply with quote

That should be:

Search for ([:digit:]*) AD
Replace with A.D. $1
_________________
LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum
Back to top
View user's profile Send private message
budfox
General User
General User


Joined: 15 Jun 2008
Posts: 34

PostPosted: Fri Dec 19, 2008 5:35 am    Post subject: Reply with quote

I tried it, but the search function can't find the key- and I used "digit" as well as various numbers, which are in the text.
Back to top
View user's profile Send private message
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Fri Dec 19, 2008 6:21 am    Post subject: Reply with quote

Weird, it worked fine for me. Did you check Regular expressions? Are you sure that you didn't type A.D. all along?
_________________
LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum
Back to top
View user's profile Send private message
keme
Moderator
Moderator


Joined: 30 Aug 2004
Posts: 2910
Location: Egersund, Norway

PostPosted: Fri Dec 19, 2008 6:22 am    Post subject: Reply with quote

You need to click the More options button to see the Regular expressions box. Check that, then do the search suggested by floris_v.

Varying number of spaces between the number and suffix might affect the result, so you can instead try searching for ([:digit:]+)[:space:]*AD and replace with A.D. $1.
Back to top
View user's profile Send private message
budfox
General User
General User


Joined: 15 Jun 2008
Posts: 34

PostPosted: Fri Dec 19, 2008 7:23 am    Post subject: Reply with quote

Ahhh!

"I see!" said the blind man.

I had to click the regular expressions box.

Works great. Gonna be a tremendous time saver.
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