Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Word Find & Replace
I have multiple name Indexes in a Word document in the following format:
{XE "First Middle Last"} {XE "First Last"} {XE "First Middle Maiden Last"} {XE "First Last Suffix"} (Jr., Sr. III) etc. I have been trying to find each group such as {XE "First Last"} and replace with {XE "Last, First"} with a Find of XE "(*) (*)" and Replace of /2, /1. The "Find" finds all of the names above, not just the ones with two names. I suspect the wildcard * does not work because of the spaces. Any help would be greatly appreciated. Cob |
#2
|
|||
|
|||
On Sat, 5 Mar 2005 16:05:02 -0800, Cob
wrote: I have multiple name Indexes in a Word document in the following format: {XE "First Middle Last"} {XE "First Last"} {XE "First Middle Maiden Last"} {XE "First Last Suffix"} (Jr., Sr. III) etc. I have been trying to find each group such as {XE "First Last"} and replace with {XE "Last, First"} with a Find of XE "(*) (*)" and Replace of /2, /1. The "Find" finds all of the names above, not just the ones with two names. I suspect the wildcard * does not work because of the spaces. Any help would be greatly appreciated. Cob The * wildcard is often a problem, because it's hard to predict what it will match. In this case, the first (*) matches the First, then the space matches, but the second (*) will match anything -- including spaces -- up to the next quote. Try this search string instead, noting that there is a space character between each exclamation and the following bracket: XE "([! ]@) ([! ]@)" The expression [! ]@ matches any consecutive sequence of characters that are not spaces. The replacement string should be XE "\2, \1" See http://word.mvps.org/faqs/general/UsingWildcards.htm for more. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org |
#3
|
|||
|
|||
Works great - thanks. Cob
"Jay Freedman" wrote: On Sat, 5 Mar 2005 16:05:02 -0800, Cob wrote: I have multiple name Indexes in a Word document in the following format: {XE "First Middle Last"} {XE "First Last"} {XE "First Middle Maiden Last"} {XE "First Last Suffix"} (Jr., Sr. III) etc. I have been trying to find each group such as {XE "First Last"} and replace with {XE "Last, First"} with a Find of XE "(*) (*)" and Replace of /2, /1. The "Find" finds all of the names above, not just the ones with two names. I suspect the wildcard * does not work because of the spaces. Any help would be greatly appreciated. Cob The * wildcard is often a problem, because it's hard to predict what it will match. In this case, the first (*) matches the First, then the space matches, but the second (*) will match anything -- including spaces -- up to the next quote. Try this search string instead, noting that there is a space character between each exclamation and the following bracket: XE "([! ]@) ([! ]@)" The expression [! ]@ matches any consecutive sequence of characters that are not spaces. The replacement string should be XE "\2, \1" See http://word.mvps.org/faqs/general/UsingWildcards.htm for more. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Boiletplates from Word Perfect | Microsoft Word Help | |||
How do I find and replace a superscript number in a word? | Microsoft Word Help | |||
word xp crashes after macros are recorded | Microsoft Word Help | |||
find and replace symbols | New Users | |||
Macro that will add the file path & date to Word footnotes? | Microsoft Word Help |