#1   Report Post  
Posted to microsoft.public.word.docmanagement
Johann Swart Johann Swart is offline
external usenet poster
 
Posts: 26
Default Search and Replace

I have many tables with hundreds of entries with the following pattern:
1ABC234DE. I need to place spaces between 1 and A, between C and 2, and
between 4 and D, in other words, the entry should be
1[space]ABC[space]234[space]DE. I intend to do a separate run for each of the
3 spaces.
For the first run, in Find and Replace, in the Find What line, I enter
(quotes not included) "([0-9])([A-Z])", and in the Replace With line, I enter
"\1[space]\2" with Use Wildcards selected. The result I get is 1A[space]BC...
..
What am I doing wrong, and is there a method of doing only one run to insert
all 3 spaces?
PS: If I should rather post this query in the Word Programming section,
please advise.
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
garfield-n-odie [MVP] garfield-n-odie [MVP] is offline
external usenet poster
 
Posts: 2,587
Default Search and Replace

Much easier to do in Excel... just copy and paste to Excel, use a
concatenate formula to add the spaces, convert formulas to
values, and then copy and paste back into Word.

Johann Swart wrote:

I have many tables with hundreds of entries with the following pattern:
1ABC234DE. I need to place spaces between 1 and A, between C and 2, and
between 4 and D, in other words, the entry should be
1[space]ABC[space]234[space]DE. I intend to do a separate run for each of the
3 spaces.
For the first run, in Find and Replace, in the Find What line, I enter
(quotes not included) "([0-9])([A-Z])", and in the Replace With line, I enter
"\1[space]\2" with Use Wildcards selected. The result I get is 1A[space]BC...
.
What am I doing wrong, and is there a method of doing only one run to insert
all 3 spaces?
PS: If I should rather post this query in the Word Programming section,
please advise.


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Search and Replace

Replace
([0-9])([A-Z]{3})([0-9]{3})([A-Z]{2})
with
\1 \2 \3 \4

See http://www.gmayor.com/replace_using_wildcards.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org

Johann Swart wrote:
I have many tables with hundreds of entries with the following
pattern: 1ABC234DE. I need to place spaces between 1 and A, between C
and 2, and between 4 and D, in other words, the entry should be
1[space]ABC[space]234[space]DE. I intend to do a separate run for
each of the 3 spaces.
For the first run, in Find and Replace, in the Find What line, I enter
(quotes not included) "([0-9])([A-Z])", and in the Replace With line,
I enter "\1[space]\2" with Use Wildcards selected. The result I get
is 1A[space]BC... .
What am I doing wrong, and is there a method of doing only one run to
insert all 3 spaces?
PS: If I should rather post this query in the Word Programming
section, please advise.



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Search and Replace

There is a bug in F&R when replacing with found strings and literals when
Track Changes is turned on, which appears to be what you are hitting here.

With Track Changes turned off, this should work ...

Find ([0-9])([A-Z]{3})([0-9]{3})([A-Z])
Replace \1[space]\2[space]\3[space]\4
Use wildcards
Replace All

--
Enjoy,
Tony

"Johann Swart" wrote in message
...
I have many tables with hundreds of entries with the following pattern:
1ABC234DE. I need to place spaces between 1 and A, between C and 2, and
between 4 and D, in other words, the entry should be
1[space]ABC[space]234[space]DE. I intend to do a separate run for each of

the
3 spaces.
For the first run, in Find and Replace, in the Find What line, I enter
(quotes not included) "([0-9])([A-Z])", and in the Replace With line, I

enter
"\1[space]\2" with Use Wildcards selected. The result I get is

1A[space]BC...
.
What am I doing wrong, and is there a method of doing only one run to

insert
all 3 spaces?
PS: If I should rather post this query in the Word Programming section,
please advise.



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Johann Swart Johann Swart is offline
external usenet poster
 
Posts: 26
Default Search and Replace

Hi Tony/Graham/Garfield

Yes, I neglegted to mention that this happens with 'Track Changes' turned ON.
Thanks for all the input and the solution. Much appreciated.

Johann Swart

"Tony Jollans" wrote:

There is a bug in F&R when replacing with found strings and literals when
Track Changes is turned on, which appears to be what you are hitting here.

With Track Changes turned off, this should work ...

Find ([0-9])([A-Z]{3})([0-9]{3})([A-Z])
Replace \1[space]\2[space]\3[space]\4
Use wildcards
Replace All

--
Enjoy,
Tony

"Johann Swart" wrote in message
...
I have many tables with hundreds of entries with the following pattern:
1ABC234DE. I need to place spaces between 1 and A, between C and 2, and
between 4 and D, in other words, the entry should be
1[space]ABC[space]234[space]DE. I intend to do a separate run for each of

the
3 spaces.
For the first run, in Find and Replace, in the Find What line, I enter
(quotes not included) "([0-9])([A-Z])", and in the Replace With line, I

enter
"\1[space]\2" with Use Wildcards selected. The result I get is

1A[space]BC...
.
What am I doing wrong, and is there a method of doing only one run to

insert
all 3 spaces?
PS: If I should rather post this query in the Word Programming section,
please advise.




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
Pasting into a search and replace Ben K. Bullock New Users 6 March 6th 06 05:50 AM
Search and Replace not working if I select a Format for Heading St Sherrie Deen Microsoft Word Help 0 April 27th 05 08:53 PM
Search and replace problem Jan Kronsell New Users 7 March 30th 05 09:57 AM
search and replace symbol characters Patricia G. Kurz Microsoft Word Help 1 December 29th 04 03:11 AM
search and replace symbols pattyjo Microsoft Word Help 2 December 29th 04 03:10 AM


All times are GMT +1. The time now is 07:15 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"