Using Find replace to reverse words: Cottage Mimosa > Mimosa Cottage,etc

  • Thread starter Thread starter Rob
  • Start date Start date
R

Rob

I have a text with names of cottages in French word order: Cottage
Mimosa, Cottage Alohi, etc.

How can I use Find/Replace to change them all to Mimosa Cottage, Alohi
Cottage, etc.?



TIA

Robin
 
The following seems to work:

1. Choose Edit | Replace.

2. Click the More button, if necessary.

3. Check the "Use wildcards" option.

4. "Find what": <(*)( )(*)>

5. "Replace with": \3\2\1

6. Click Replace All.

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
Note that if your document contains more than a list of names, it
isn't a good idea to use the suggested search. :-(

Hopefully, someone can come up with a better idea.

--
Stefan Blom
Microsoft Word MVP


in message
 
Improving slightly on Stefan's solution, this seems to work if the cottage
names are inside a paragraph of normal text:

Find What: (Cottage)( )(*>)
Replace With: \3\2\1

Cheers,

Chris.
 
Replace (wildcards)
(Cottage) ([a-zA-Z]{2,})
with
\2 \1

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Now I'm going to make it harder ;)

Some of the cottages have names like

Cottage Espace 4
Cottage Laurier Rose

But they are on separate lines. No other text on the line

Robin
 
It's OK. I did the more complicated ones manually. But thanks. This
saved me about 60 simple instances.
 
Assuming that I understood it correctly, this search finds A (the word
"Cottage"), a space, and B (a word with at least two characters, which
can be uppercase or lowercase letters) and replaces it with B, a
space, and A.

I'm not sure what the restriction on B is for?

--
Stefan Blom
Microsoft Word MVP


in message
Replace (wildcards)
(Cottage) ([a-zA-Z]{2,})
with
\2 \1

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Stefan said:
Note that if your document contains more than a list of names, it
isn't a good idea to use the suggested search. :-(

Hopefully, someone can come up with a better idea.


in message
 
It's just a way of ensuring you get the next word. The number is not
especially important as long as it is less than the likely number of
characters in 'B'
ChrisM's suggestion of (Cottage) (*>) should work equally well, though
personally I don't much care for the * wildcard if it can be avoided.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Stefan said:
Assuming that I understood it correctly, this search finds A (the word
"Cottage"), a space, and B (a word with at least two characters, which
can be uppercase or lowercase letters) and replaces it with B, a
space, and A.

I'm not sure what the restriction on B is for?


in message
Replace (wildcards)
(Cottage) ([a-zA-Z]{2,})
with
\2 \1

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Stefan said:
Note that if your document contains more than a list of names, it
isn't a good idea to use the suggested search. :-(

Hopefully, someone can come up with a better idea.


in message
The following seems to work:

1. Choose Edit | Replace.

2. Click the More button, if necessary.

3. Check the "Use wildcards" option.

4. "Find what": <(*)( )(*)>

5. "Replace with": \3\2\1

6. Click Replace All.

--
Stefan Blom
Microsoft Word MVP


in message
I have a text with names of cottages in French word order: Cottage
Mimosa, Cottage Alohi, etc.

How can I use Find/Replace to change them all to Mimosa Cottage,
Alohi Cottage, etc.?



TIA

Robin
 
Thank you for the clarification.

--
Stefan Blom
Microsoft Word MVP


in message
It's just a way of ensuring you get the next word. The number is not
especially important as long as it is less than the likely number of
characters in 'B'
ChrisM's suggestion of (Cottage) (*>) should work equally well, though
personally I don't much care for the * wildcard if it can be avoided.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Stefan said:
Assuming that I understood it correctly, this search finds A (the word
"Cottage"), a space, and B (a word with at least two characters, which
can be uppercase or lowercase letters) and replaces it with B, a
space, and A.

I'm not sure what the restriction on B is for?


in message
Replace (wildcards)
(Cottage) ([a-zA-Z]{2,})
with
\2 \1

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Stefan Blom wrote:
Note that if your document contains more than a list of names, it
isn't a good idea to use the suggested search. :-(

Hopefully, someone can come up with a better idea.


in message
The following seems to work:

1. Choose Edit | Replace.

2. Click the More button, if necessary.

3. Check the "Use wildcards" option.

4. "Find what": <(*)( )(*)>

5. "Replace with": \3\2\1

6. Click Replace All.

--
Stefan Blom
Microsoft Word MVP


in message
I have a text with names of cottages in French word order: Cottage
Mimosa, Cottage Alohi, etc.

How can I use Find/Replace to change them all to Mimosa Cottage,
Alohi Cottage, etc.?



TIA

Robin
 
Back
Top