Question about search and replace

G

Gilles Vanneste

I have a document that is utterly filled with data from person addresses to
phone numbers. Now all the phone numbers are formed like this : xx.xx.xx,
and I forgot to add the first three digits of those numbers. I don't want to
have to manually place them one by one, so I looked a bit at the different
functions I can use. My question is, I noticed the search function has an
option to search and replace words. I want to replace all the phone numbers
of the form xx.xx.xx with the same three digits for every phone number in
front of it (xxx), so the end result is that all the phone numbers in my
document are like this (056)xx.xx.xx . How do I do I use the search and
replace function to accomplish this? I can't seem to find the right way to
do it.
 
J

Jay Freedman

Gilles said:
I have a document that is utterly filled with data from person
addresses to phone numbers. Now all the phone numbers are formed like
this : xx.xx.xx, and I forgot to add the first three digits of those
numbers. I don't want to have to manually place them one by one, so I
looked a bit at the different functions I can use. My question is, I
noticed the search function has an option to search and replace
words. I want to replace all the phone numbers of the form xx.xx.xx
with the same three digits for every phone number in front of it
(xxx), so the end result is that all the phone numbers in my document
are like this (056)xx.xx.xx . How do I do I use the search and
replace function to accomplish this? I can't seem to find the right
way to do it.

Enter this expression in the Find What box (the code ^# finds any single
digit):

^#^#.^#^#.^#^#

and enter this expression in the Replace With box (the code ^& means "the
text that was found"):

(506)^&

Then click the Replace All button.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Gilles Vanneste

Thanks for the help, it worked!


Jay Freedman said:
Enter this expression in the Find What box (the code ^# finds any single
digit):

^#^#.^#^#.^#^#

and enter this expression in the Replace With box (the code ^& means "the
text that was found"):

(506)^&

Then click the Replace All button.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup
so all may benefit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top