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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|