#1   Report Post  
Cob
 
Posts: n/a
Default 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   Report Post  
Jay Freedman
 
Posts: n/a
Default

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   Report Post  
Cob
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Boiletplates from Word Perfect linda Microsoft Word Help 1 January 28th 05 05:37 PM
How do I find and replace a superscript number in a word? Steve Starling Microsoft Word Help 2 January 28th 05 04:38 AM
word xp crashes after macros are recorded kharris0405 Microsoft Word Help 3 January 11th 05 10:50 PM
find and replace symbols Tewodaj New Users 8 January 11th 05 02:22 AM
Macro that will add the file path & date to Word footnotes? Rich P Microsoft Word Help 2 December 15th 04 07:49 PM


All times are GMT +1. The time now is 05:57 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"