Reply
 
Thread Tools Display Modes
  #1   Report Post  
dk
 
Posts: n/a
Default wildcard replacing

We have a document that we want to replace all spaces to commas,but 1
exception that the space which is before the word Ave or St and also the 1
word prior to those words shall also not be replaced ex: mr,John,Doe,123 45
St,Boston,MA,10234
how can we do that using wildcards etc.?
  #2   Report Post  
Greg
 
Posts: n/a
Default

dk,

I don't know how or if this could be done in a single pass and a better way
may come along. Your example is not the best. I am assuming that you have
mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace field, click
format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane, Place, Court,
etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with commas.
You don't need wildcards for this bit. With the cursor in the find field
type a single space, click FormatHighlight and Format Highlight. You should
see "Not Highlight" displayed under the field field. In the Replace field
type a comma and use FormatHighlight to clear the Hightlight formatting from
under the replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and remove
the space. Click FormatHightlight to display Highlighted under the find
field. Click in the replace window and clear all content. Click
FormatHighlight to display Not highligthed below the replace with field.
Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to commas,but 1
exception that the space which is before the word Ave or St and also the 1
word prior to those words shall also not be replaced ex: mr,John,Doe,123 45
St,Boston,MA,10234
how can we do that using wildcards etc.?

  #3   Report Post  
dk
 
Posts: n/a
Default

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D€¢1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a better way
may come along. Your example is not the best. I am assuming that you have
mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace field, click
format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane, Place, Court,
etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with commas.
You don't need wildcards for this bit. With the cursor in the find field
type a single space, click FormatHighlight and Format Highlight. You should
see "Not Highlight" displayed under the field field. In the Replace field
type a comma and use FormatHighlight to clear the Hightlight formatting from
under the replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and remove
the space. Click FormatHightlight to display Highlighted under the find
field. Click in the replace window and clear all content. Click
FormatHighlight to display Not highligthed below the replace with field.
Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to commas,but 1
exception that the space which is before the word Ave or St and also the 1
word prior to those words shall also not be replaced ex: mr,John,Doe,123 45
St,Boston,MA,10234
how can we do that using wildcards etc.?

  #4   Report Post  
dk
 
Posts: n/a
Default

we want no coma before 46th and before St. and 47th St. D€¢1 because we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D€¢1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D€¢1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a better way
may come along. Your example is not the best. I am assuming that you have
mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace field, click
format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane, Place, Court,
etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with commas.
You don't need wildcards for this bit. With the cursor in the find field
type a single space, click FormatHighlight and Format Highlight. You should
see "Not Highlight" displayed under the field field. In the Replace field
type a comma and use FormatHighlight to clear the Hightlight formatting from
under the replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and remove
the space. Click FormatHightlight to display Highlighted under the find
field. Click in the replace window and clear all content. Click
FormatHighlight to display Not highligthed below the replace with field.
Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to commas,but 1
exception that the space which is before the word Ave or St and also the 1
word prior to those words shall also not be replaced ex: mr,John,Doe,123 45
St,Boston,MA,10234
how can we do that using wildcards etc.?

  #5   Report Post  
Greg Maxey
 
Posts: n/a
Default

dk,

Part of the the problem is your line are separated by line breaks vice
paragraphs. The search string I provided previously will not work with the
line breaks. So first fine ^l and replace with ^13. You don't need wild
cards for that search. Now excluding appartment numbers, which you didn't
mention your first expample or telephone numbers for that matter, your first
example should come out like this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to need to
make it (or at least the space between it and the street address, standout
with higlight as well. In the example you provided the following would work
as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is (space)[!space]yoursymbol
The string is looking for a space, then anything but a space, then your
symbol. You will need to copy your symbol from the document and paste it
using CTRL+v into the find what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1 because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you
could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the find
field type a single space, click FormatHighlight and Format
Highlight. You should see "Not Highlight" displayed under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under the
replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and
remove the space. Click FormatHightlight to display Highlighted
under the find field. Click in the replace window and clear all
content. Click FormatHighlight to display Not highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word Ave
or St and also the 1 word prior to those words shall also not be
replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?





  #6   Report Post  
dk
 
Posts: n/a
Default

We have no luck can you please explain all the characters, we don't seem to
find any line breaks lets try another way around all the spaces that are less
then 6 characters before the word ave. or st rd ct. shall be replaced with
odd charachter and the we will replace the spaces with commas so there will
be no spaces in the street field , please explain when you instruct what the
barcket etc. is making
"Greg Maxey" wrote:

dk,

Part of the the problem is your line are separated by line breaks vice
paragraphs. The search string I provided previously will not work with the
line breaks. So first fine ^l and replace with ^13. You don't need wild
cards for that search. Now excluding appartment numbers, which you didn't
mention your first expample or telephone numbers for that matter, your first
example should come out like this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to need to
make it (or at least the space between it and the street address, standout
with higlight as well. In the example you provided the following would work
as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is (space)[!space]yoursymbol
The string is looking for a space, then anything but a space, then your
symbol. You will need to copy your symbol from the document and paste it
using CTRL+v into the find what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1 because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you
could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the find
field type a single space, click FormatHighlight and Format
Highlight. You should see "Not Highlight" displayed under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under the
replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and
remove the space. Click FormatHightlight to display Highlighted
under the find field. Click in the replace window and clear all
content. Click FormatHighlight to display Not highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word Ave
or St and also the 1 word prior to those words shall also not be
replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?




  #7   Report Post  
dk
 
Posts: n/a
Default

also if we can make different for captilized letters also replacing a space
by counting the letters for example 122445 st shall be able to seperate with
a space with 2 letters prior to st

"Greg Maxey" wrote:

dk,

Part of the the problem is your line are separated by line breaks vice
paragraphs. The search string I provided previously will not work with the
line breaks. So first fine ^l and replace with ^13. You don't need wild
cards for that search. Now excluding appartment numbers, which you didn't
mention your first expample or telephone numbers for that matter, your first
example should come out like this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to need to
make it (or at least the space between it and the street address, standout
with higlight as well. In the example you provided the following would work
as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is (space)[!space]yoursymbol
The string is looking for a space, then anything but a space, then your
symbol. You will need to copy your symbol from the document and paste it
using CTRL+v into the find what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1 because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you
could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the find
field type a single space, click FormatHighlight and Format
Highlight. You should see "Not Highlight" displayed under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under the
replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and
remove the space. Click FormatHightlight to display Highlighted
under the find field. Click in the replace window and clear all
content. Click FormatHighlight to display Not highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word Ave
or St and also the 1 word prior to those words shall also not be
replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?




  #8   Report Post  
Graham Mayor
 
Posts: n/a
Default

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


dk wrote:
We have no luck can you please explain all the characters, we don't
seem to find any line breaks lets try another way around all the
spaces that are less then 6 characters before the word ave. or st rd
ct. shall be replaced with odd charachter and the we will replace the
spaces with commas so there will be no spaces in the street field ,
please explain when you instruct what the barcket etc. is making
"Greg Maxey" wrote:

dk,

Part of the the problem is your line are separated by line breaks
vice paragraphs. The search string I provided previously will not
work with the line breaks. So first fine ^l and replace with ^13.
You don't need wild cards for that search. Now excluding appartment
numbers, which you didn't mention your first expample or telephone
numbers for that matter, your first example should come out like
this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to
need to make it (or at least the space between it and the street
address, standout with higlight as well. In the example you
provided the following would work as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is
(space)[!space]yoursymbol The string is looking for a space, then
anything but a space, then your symbol. You will need to copy your
symbol from the document and paste it using CTRL+v into the find
what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1 because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you
could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the
find field type a single space, click FormatHighlight and Format
Highlight. You should see "Not Highlight" displayed under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under the
replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and
remove the space. Click FormatHightlight to display Highlighted
under the find field. Click in the replace window and clear all
content. Click FormatHighlight to display Not highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word
Ave
or St and also the 1 word prior to those words shall also not be
replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?



  #9   Report Post  
Greg Maxey
 
Posts: n/a
Default

dk,

Now I am hopelessly confused.

You can send me an e-mail with a word attachment that includes a small
sample of what you have and what you want it to look like. I will see if I
can come up with a solution. Do not include any macros in the document.


Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
also if we can make different for captilized letters also replacing a
space by counting the letters for example 122445 st shall be able to
seperate with a space with 2 letters prior to st

"Greg Maxey" wrote:

dk,

Part of the the problem is your line are separated by line breaks
vice paragraphs. The search string I provided previously will not
work with the line breaks. So first fine ^l and replace with ^13.
You don't need wild cards for that search. Now excluding appartment
numbers, which you didn't mention your first expample or telephone
numbers for that matter, your first example should come out like
this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to
need to make it (or at least the space between it and the street
address, standout with higlight as well. In the example you
provided the following would work as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is
(space)[!space]yoursymbol The string is looking for a space, then
anything but a space, then your symbol. You will need to copy your
symbol from the document and paste it using CTRL+v into the find
what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1 because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you
could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the
find field type a single space, click FormatHighlight and Format
Highlight. You should see "Not Highlight" displayed under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under the
replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and
remove the space. Click FormatHightlight to display Highlighted
under the find field. Click in the replace window and clear all
content. Click FormatHighlight to display Not highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word
Ave
or St and also the 1 word prior to those words shall also not be
replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?



  #10   Report Post  
dk
 
Posts: n/a
Default

we couldn't find your email add
so we are almost at the final steps, but because this is a very large add.
list there are different types of mistakes etc. our goal is as the beggining
but some times the whole add has no spaces 144645 St which has to be 1446 45
St so we want to correct this , also we don't understand if we have sometimes
apt. no. , bassically is there some way to put in spaces with counting
characters as per example 3 characters before St. shall have a space, also 2
character after shall have a space we hope we shall finish with that
thank you


"Greg Maxey" wrote:

dk,

Now I am hopelessly confused.

You can send me an e-mail with a word attachment that includes a small
sample of what you have and what you want it to look like. I will see if I
can come up with a solution. Do not include any macros in the document.


Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
also if we can make different for captilized letters also replacing a
space by counting the letters for example 122445 st shall be able to
seperate with a space with 2 letters prior to st

"Greg Maxey" wrote:

dk,

Part of the the problem is your line are separated by line breaks
vice paragraphs. The search string I provided previously will not
work with the line breaks. So first fine ^l and replace with ^13.
You don't need wild cards for that search. Now excluding appartment
numbers, which you didn't mention your first expample or telephone
numbers for that matter, your first example should come out like
this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to
need to make it (or at least the space between it and the street
address, standout with higlight as well. In the example you
provided the following would work as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is
(space)[!space]yoursymbol The string is looking for a space, then
anything but a space, then your symbol. You will need to copy your
symbol from the document and paste it using CTRL+v into the find
what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1 because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you
could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the
find field type a single space, click FormatHighlight and Format
Highlight. You should see "Not Highlight" displayed under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under the
replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and
remove the space. Click FormatHightlight to display Highlighted
under the find field. Click in the replace window and clear all
content. Click FormatHighlight to display Not highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word
Ave
or St and also the 1 word prior to those words shall also not be
replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?






  #11   Report Post  
Greg Maxey
 
Posts: n/a
Default

Let's try this again using the following two examples:

Bill Smith 123 Cherry St. Brooklyn NY 12345 888 777-1234
Mary Jones 123 West 52nd St. Apt. D5 Queens NY 12345 888 747-1334

You want finished product to look like this correct? If not then stop here
and let me know what it is you want.

Bill Smith,123 Cherry St.,Brooklyn,NY,12345,888.777.1234
Mary Jones,1235 West 52nd St. Apt. D5,Queens,NY,12345,888.747.1334

OK, first make sure the lines end with paragraph marks and not line breaks.
Display non-printing characters CTRL+Shift+* Do you see pilcrows (backward
looking Ps) at the end of each line? Yes, good. No, then replace ^l with
^13.

Now with paragraph marks at the end of each line we can continue.

With wildcards, find: [0-9][!^13]@St.
Click in the replace window and press formathiglight
Click replace all
The string above looks for any number, then all characters except a
paragraph mar, and then stops with the period following St. It selects
this block and then higlights it.

Note: If all of your addresses end with a period (i.e., Ln. Ct. Blvd, Rd.
Pl. Ave. etc) then you can change find string to: [0-9][!^13]@.

Ok, now we need to deal with the Apt. number

For the example above we could use: .[!^13]@[A-Z][0-9]

The sting looks for the first period, any characters except a paragraph mark
a Cap letter and a number. So it finds (. Apt. D5). Note- if you address
don't end with a period e.g., Ave then you would have to use something like:
e[!^13]@[A-Z][0-9]

You may have to do multiple passes to capture all of the various
combinations of addresses that you have used.

Once you have all of the street addresses highlighted, the method I provided
earlier will work to replace the unhighlighted spaces with commas.

Good luck.




--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
We have no luck can you please explain all the characters, we don't
seem to find any line breaks lets try another way around all the
spaces that are less then 6 characters before the word ave. or st rd
ct. shall be replaced with odd charachter and the we will replace the
spaces with commas so there will be no spaces in the street field ,
please explain when you instruct what the barcket etc. is making
"Greg Maxey" wrote:

dk,

Part of the the problem is your line are separated by line breaks
vice paragraphs. The search string I provided previously will not
work with the line breaks. So first fine ^l and replace with ^13.
You don't need wild cards for that search. Now excluding appartment
numbers, which you didn't mention your first expample or telephone
numbers for that matter, your first example should come out like
this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to
need to make it (or at least the space between it and the street
address, standout with higlight as well. In the example you
provided the following would work as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is
(space)[!space]yoursymbol The string is looking for a space, then
anything but a space, then your symbol. You will need to copy your
symbol from the document and paste it using CTRL+v into the find
what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1 because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the text.
Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the you
could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the
find field type a single space, click FormatHighlight and Format
Highlight. You should see "Not Highlight" displayed under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under the
replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl and
remove the space. Click FormatHightlight to display Highlighted
under the find field. Click in the replace window and clear all
content. Click FormatHighlight to display Not highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word
Ave
or St and also the 1 word prior to those words shall also not be
replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?



  #12   Report Post  
Greg Maxey
 
Posts: n/a
Default

DK,

Find ([0-9])([0-9]{2})( St.) Note the "space" (spaceSt.)
Replace: \1 \2\3 thats \1space\2\3

Here you have three groups indicated by the ( ).
Group 1 finds a number
Group 2 finds two numbers
Group 3 finds a space and St.

So using your example 144645, you would find the part 645 St.

Now the replace puts back group 1, then a space then groups 2 and 3


This will convert 144645 St. to 1446 45 St.

I don't understand the second part of your question,



My email backwards is gro.spvm@yexamg turn it around to send mail.
I am about to sign off here for the day.

Good luck
--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we couldn't find your email add
so we are almost at the final steps, but because this is a very large
add. list there are different types of mistakes etc. our goal is as
the beggining but some times the whole add has no spaces 144645 St
which has to be 1446 45 St so we want to correct this , also we don't
understand if we have sometimes apt. no. , bassically is there some
way to put in spaces with counting characters as per example 3
characters before St. shall have a space, also 2 character after
shall have a space we hope we shall finish with that
thank you


"Greg Maxey" wrote:

dk,

Now I am hopelessly confused.

You can send me an e-mail with a word attachment that includes a
small sample of what you have and what you want it to look like. I
will see if I can come up with a solution. Do not include any
macros in the document.


Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
also if we can make different for captilized letters also replacing
a space by counting the letters for example 122445 st shall be able
to seperate with a space with 2 letters prior to st

"Greg Maxey" wrote:

dk,

Part of the the problem is your line are separated by line breaks
vice paragraphs. The search string I provided previously will not
work with the line breaks. So first fine ^l and replace with ^13.
You don't need wild cards for that search. Now excluding
appartment numbers, which you didn't mention your first expample
or telephone numbers for that matter, your first example should
come out like
this:

Porges,Samiel,1223 46th St.,Brooklyn,NY,11219,718-436-8449

Now there is the issue of the appartment number. You are going to
need to make it (or at least the space between it and the street
address, standout with higlight as well. In the example you
provided the following would work as a separate search string.

Using wildcards, find ( )[! ]yoursymbol That is
(space)[!space]yoursymbol The string is looking for a space, then
anything but a space, then your symbol. You will need to copy your
symbol from the document and paste it using CTRL+v into the find
what field.


--
Greg Maxey/Word MVP
A Peer in Peer to Peer Support

dk wrote:
we want no coma before 46th and before St. and 47th St. D.1
because
we want
to make a table so have all feilds seperate columns
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791



"dk" wrote:

please see this sample we tried the first step but it didn't work
Porges Samiel 1223 46th St. Brooklyn NY 11219 718-436-8449
Porges S. 1358 47th St. D.1 Brooklyn NY 11219 718.851-2791


"Greg" wrote:

dk,

I don't know how or if this could be done in a single pass and a
better way may come along. Your example is not the best. I am
assuming that you have mulitple lines something like this

Mr Joe Jones 123 Miller St Boston MA 12345
Mrs Ann Smith 345 Park Ave Boston MA 12345
etc.

This could be done in multiple passes.

First make the street address stand out from the rest of the
text. Highlighting is one way to do this.

Using wildcards find: [0-9]*Ave
Replace with ^& - Now with the cursor still in the replace
field, click format highlight.

Relace all

You will have to repeat a similar process for St, Blvd, Lane,
Place, Court, etc. If you use Ave. Rd. St. Blvd. Ct. etc, the
you could just use [0-9]*.

OK, next we want to replace spaces that are not highlighted with
commas.
You don't need wildcards for this bit. With the cursor in the
find field type a single space, click FormatHighlight and
Format Highlight. You should see "Not Highlight" displayed
under the
field field. In the Replace field type a comma and use
FormatHighlight to clear the Hightlight formatting from under
the replace with window. Click replace all.

Next you want to remove hightlighing. Click in the find fiedl
and remove the space. Click FormatHightlight to display
Highlighted under the find field. Click in the replace window
and clear all content. Click FormatHighlight to display Not
highligthed below
the replace with field. Click replace all.

HTH.

"dk" wrote:

We have a document that we want to replace all spaces to
commas,but 1 exception that the space which is before the word
Ave
or St and also the 1 word prior to those words shall also not
be replaced ex: mr,John,Doe,123 45 St,Boston,MA,10234
how can we do that using wildcards etc.?



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
replacing fonts between references word_user Microsoft Word Help 3 January 15th 05 03:53 AM
get ~$ replacing letters in file name badwrc Microsoft Word Help 4 January 7th 05 05:39 AM
Replace and retain whatever the wildcard represents HONYAKUKA Microsoft Word Help 2 January 4th 05 04:12 AM
Replacing style of paragraphs with another style automatically Shailesh Microsoft Word Help 3 December 21st 04 07:25 PM
Replacing my Normal.doc template for Word 2003 DrewUC Microsoft Word Help 2 November 24th 04 03:57 PM


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