My Find and Replace methods are not working

T

Tonya Marshall

I want to replace text following 2 paragraphs and the paragraph
following the text with a paragraph. The text is all caps.
I tried finding ^p^p[A-Z]^p
and replacing with ^p and nothing happens.

Another way the text can be is at the beginning of a paragraph followed
by a \
Word or words are: ALL CAPS\

Thanks
 
D

Doug Robbins - Word MVP

Hi Tonya,

You will need to check the "Wildcards" box that becomes visible after
clicking on the "More" button in the Edit>Replace dialog and then use

^13^13[A-Z. ]{1,}^13

in the Find what control and the ^p in the replace with.

I've assumed that the paragraph of uppercase text includes some spaces and a
period. If it includes commas or other punctuation marks as well, you would
need to include them in the [ ]

See the article "Finding and replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
T

Tonya Marshall

I trust that the supertext 13 is really ^13. Running the script I get 0
results. I tried just making it ^13^13[A-Z]^13 and still got no results.
If I could just get rid of the all caps words and the extra paragraphs,
I would be happy. The resulting white text at the beginning of the line
would be easy to get rid of plus any comma spaces.

Here is an example of what I am trying to clean up:
(space
(space
TITLE (SOME HAVE COMMA SPACE BETWEEN WORDS. SOME HAVE WORDS WITH SPACES
BETWEEN))
(space)
Text

None of the titles have periods. Also, the titles are Normal style, not
Title style.

I did read the FAQ article before posting the question and going back
and pondering it more doesn't help me figure it out.
 
T

Tonya Marshall

Ack! Those (space)s should be (Paragraphs) and I've just experienced how
the second ^13 got changed to supertext.


Tonya said:
I trust that the supertext 13 is really ^13. Running the script I get 0
results. I tried just making it ^13^13[A-Z]^13 and still got no results.
If I could just get rid of the all caps words and the extra paragraphs,
I would be happy. The resulting white text at the beginning of the line
would be easy to get rid of plus any comma spaces.

Here is an example of what I am trying to clean up:
(space
(space
TITLE (SOME HAVE COMMA SPACE BETWEEN WORDS. SOME HAVE WORDS WITH SPACES
BETWEEN))
(space)
Text

None of the titles have periods. Also, the titles are Normal style, not
Title style.

I did read the FAQ article before posting the question and going back
and pondering it more doesn't help me figure it out.
Hi Tonya,

You will need to check the "Wildcards" box that becomes visible after
clicking on the "More" button in the Edit>Replace dialog and then use

^13^13[A-Z. ]{1,}^13

in the Find what control and the ^p in the replace with.

I've assumed that the paragraph of uppercase text includes some spaces and a
period. If it includes commas or other punctuation marks as well, you would
need to include them in the [ ]

See the article "Finding and replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm
 
T

Tonya Marshall

Well you all must think I'm nuts. I use Mozilla for my mail and news and
any number following a ^ which follows text or numbers without a space
before it gets superscripted. It doesn't in IE so you don't see what I'm
seeing.
--
Tonya Marshall
tonz AT harborside DOT com


Tonya said:
Ack! Those (space)s should be (Paragraphs) and I've just experienced how
the second ^13 got changed to supertext.


Tonya said:
I trust that the supertext 13 is really ^13. Running the script I get 0
results. I tried just making it ^13^13[A-Z]^13 and still got no results.
If I could just get rid of the all caps words and the extra paragraphs,
I would be happy. The resulting white text at the beginning of the line
would be easy to get rid of plus any comma spaces.

Here is an example of what I am trying to clean up:
(space
(space
TITLE (SOME HAVE COMMA SPACE BETWEEN WORDS. SOME HAVE WORDS WITH SPACES
BETWEEN))
(space)
Text

None of the titles have periods. Also, the titles are Normal style, not
Title style.

I did read the FAQ article before posting the question and going back
and pondering it more doesn't help me figure it out.
Hi Tonya,

You will need to check the "Wildcards" box that becomes visible after
clicking on the "More" button in the Edit>Replace dialog and then use

^13^13[A-Z. ]{1,}^13

in the Find what control and the ^p in the replace with.

I've assumed that the paragraph of uppercase text includes some spaces and a
period. If it includes commas or other punctuation marks as well, you would
need to include them in the [ ]

See the article "Finding and replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm
 
D

Doug Robbins - Word MVP

Allowing for Mozilla's idiosyncracy, you are going to need to do two Edit
Replaces, one for

^13^13[A-Z, ]{1,}^13

for the case where there are commas and spaces and the other for

^13^13[A-Z ]{1,}^13

for the case where there are no commas but just spaces.

for ^13 you need to type a caret (Shift+6) then 13.
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Tonya Marshall said:
Well you all must think I'm nuts. I use Mozilla for my mail and news and
any number following a ^ which follows text or numbers without a space
before it gets superscripted. It doesn't in IE so you don't see what I'm
seeing.
--
Tonya Marshall
tonz AT harborside DOT com


Tonya said:
Ack! Those (space)s should be (Paragraphs) and I've just experienced how
the second ^13 got changed to supertext.


Tonya said:
I trust that the supertext 13 is really ^13. Running the script I get 0
results. I tried just making it ^13^13[A-Z]^13 and still got no results.
If I could just get rid of the all caps words and the extra paragraphs,
I would be happy. The resulting white text at the beginning of the line
would be easy to get rid of plus any comma spaces.

Here is an example of what I am trying to clean up:
(space
(space
TITLE (SOME HAVE COMMA SPACE BETWEEN WORDS. SOME HAVE WORDS WITH SPACES
BETWEEN))
(space)
Text

None of the titles have periods. Also, the titles are Normal style, not
Title style.

I did read the FAQ article before posting the question and going back
and pondering it more doesn't help me figure it out.

Doug Robbins - Word MVP wrote:
Hi Tonya,

You will need to check the "Wildcards" box that becomes visible after
clicking on the "More" button in the Edit>Replace dialog and then use

^13^13[A-Z. ]{1,}^13

in the Find what control and the ^p in the replace with.

I've assumed that the paragraph of uppercase text includes some spaces and a
period. If it includes commas or other punctuation marks as well, you would
need to include them in the [ ]

See the article "Finding and replacing characters using wildcards" at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm
 
T

Tonya Marshall

That did it! Thanks, Doug. I've eliminated over 50 titles in my document
very quickly. I'm puzzled about what the {1,} does in the script.
 
D

Doug Robbins - Word MVP

Hi Tonya,

The {1,} means one or more of the characters in the preceding [ ] In the
first case [A-Z, ]{1,} Igave you, that would be one of more characters in
the range A to Z, one or more spaces and one or more commas.

If there are no commas, that would not work however which is the reason for
the second case [A-Z ]{1,} where it is just looking for one or more
characters in the range A to Z and one or more spaces.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Tonya Marshall said:
That did it! Thanks, Doug. I've eliminated over 50 titles in my document
very quickly. I'm puzzled about what the {1,} does in the script.
--
Tonya Marshall
tonz AT harborside DOT com
Allowing for Mozilla's idiosyncracy, you are going to need to do two Edit
Replaces, one for

^13^13[A-Z, ]{1,}^13

for the case where there are commas and spaces and the other for

^13^13[A-Z ]{1,}^13

for the case where there are no commas but just spaces.

for ^13 you need to type a caret (Shift+6) then 13.
 
T

Tonya Marshall

It's behaves somewhat like the macro I wanted to change >1 spaces to a
tab, then, this being a different operation for it. Am I correct in
forming that conclusion?
I appreciate you taking the time to explain. Thank you.
 
D

Doug Robbins - Word MVP

Hi Tonya,

Use [A-Z ]{1,}^t

That will find a series of words separated by spaces followed by a tab

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
T

Tonya Marshall

lol ... I think we're on different wavelengths here. I had asked in an
earlier post for a macro to remove >1 spaces and replacing them with a
tab. Perhaps my thinking's off, but I thought I was seeing similarities
in the macro and the replace code: in the replace code the {1,}, and,
in the macro the {2,}.

Hi Tonya,

Use [A-Z ]{1,}^t

That will find a series of words separated by spaces followed by a tab
 
D

Doug Robbins - Word MVP

Hi Tonya,

OK, I recall that one now where I suggested using {2,} inplace of the
{2,100} that had been suggested.

Not real sure what you present question is, or even if there is a question,
but the first numeral after the { sets the required minimum number of
instances of the preceding items[ ] that will be looked for. If there is no
number after the comma inside the { }, then there is no upper limit to the
number of instances that will be looked for. The presence of a number in
that position sets the upper limit.

So for example if you were looking for at least 2 instances of something,
but less that 4, you would use

{2,4}

If you use that, it will ignore 5 or more instances of the thing.

On the other hand {2,} will find 2 or any greater number of instances.

This sort of notation did not however appear in the replace string and
cannot be used in the replace string.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Tonya Marshall said:
lol ... I think we're on different wavelengths here. I had asked in an
earlier post for a macro to remove >1 spaces and replacing them with a
tab. Perhaps my thinking's off, but I thought I was seeing similarities
in the macro and the replace code: in the replace code the {1,}, and,
in the macro the {2,}.

Hi Tonya,

Use [A-Z ]{1,}^t

That will find a series of words separated by spaces followed by a tab
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top