A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Find and Replace



 
 
Thread Tools Display Modes
  #1  
Old March 9th, 2009, 12:10 AM posted to microsoft.public.word.newusers
Island Girl
external usenet poster
 
Posts: 227
Default Find and Replace

I was asked to delete all company names from a very, very long document and
replace with XXXX's.

Since all of the names were at least two words, I tried to find two or more
words in a row that start with capital letters, but nothing I tried worked.
It would find capitalized words but the "find" would stretch across two or
more sentences from one found word to the other. How do I find the words
side by side instead of far apart?

Greg Maxey set me straight on an earlier question regarding the beginnings
of words and I've been able to use it very nicely. Now I just need to carry
that a bit further and find two or more words in a row that start with caps.

I just love this stuff! And it's all thanks to this wonderful website.
  #2  
Old March 9th, 2009, 12:42 AM posted to microsoft.public.word.newusers
Greg Maxey[_2_]
external usenet poster
 
Posts: 649
Default Find and Replace

IG,

This is one where you have to be very specific:

[A-Z][a-z]{1,} [A-Z][a-z]{1,}

Island Girl wrote:
I was asked to delete all company names from a very, very long
document and replace with XXXX's.

Since all of the names were at least two words, I tried to find two
or more words in a row that start with capital letters, but nothing I
tried worked. It would find capitalized words but the "find" would
stretch across two or more sentences from one found word to the
other. How do I find the words side by side instead of far apart?

Greg Maxey set me straight on an earlier question regarding the
beginnings of words and I've been able to use it very nicely. Now I
just need to carry that a bit further and find two or more words in a
row that start with caps.

I just love this stuff! And it's all thanks to this wonderful
website.


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org



  #3  
Old March 9th, 2009, 12:56 AM posted to microsoft.public.word.newusers
Greg Maxey[_2_]
external usenet poster
 
Posts: 649
Default Find and Replace

I just realized that you said two or more words. I don't know if that can
be done in one swoop or not. You might have to determine the longest name
(e.g., 4 words) set up the find for that, then reduce to 3, then finally run
the code I provided for 2.

Island Girl wrote:
I was asked to delete all company names from a very, very long
document and replace with XXXX's.

Since all of the names were at least two words, I tried to find two
or more words in a row that start with capital letters, but nothing I
tried worked. It would find capitalized words but the "find" would
stretch across two or more sentences from one found word to the
other. How do I find the words side by side instead of far apart?

Greg Maxey set me straight on an earlier question regarding the
beginnings of words and I've been able to use it very nicely. Now I
just need to carry that a bit further and find two or more words in a
row that start with caps.

I just love this stuff! And it's all thanks to this wonderful
website.


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org



  #4  
Old March 9th, 2009, 04:03 PM posted to microsoft.public.word.newusers
Island Girl
external usenet poster
 
Posts: 227
Default Find and Replace

Hi, Greg:

Thanks again for your swift reply and wonderful help! You got me on the
right track with your last reply (re "but not") and helped me solve my latest
problem.

"Greg Maxey" wrote:

I just realized that you said two or more words. I don't know if that can
be done in one swoop or not. You might have to determine the longest name
(e.g., 4 words) set up the find for that, then reduce to 3, then finally run
the code I provided for 2.

Island Girl wrote:
I was asked to delete all company names from a very, very long
document and replace with XXXX's.

Since all of the names were at least two words, I tried to find two
or more words in a row that start with capital letters, but nothing I
tried worked. It would find capitalized words but the "find" would
stretch across two or more sentences from one found word to the
other. How do I find the words side by side instead of far apart?

Greg Maxey set me straight on an earlier question regarding the
beginnings of words and I've been able to use it very nicely. Now I
just need to carry that a bit further and find two or more words in a
row that start with caps.

I just love this stuff! And it's all thanks to this wonderful
website.


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.