Can Find X, and Replace Y with Z Be Done?

I

irasiegel1

I'm using Office 2004 with Mac OS 10.4.11.
I would like to find "X" (a series of characters and/or format
instructions (like tab or paragraph), then replace "Y" (a subset of X)
with "Z" (which could be anything).
Currently, in a long list I am trying to find "X," namely "^p^# (i.e.,
a paragraph mark followed by any digit), and then replace "Y", namely
"^p" (i.e., the paragraph mark) with "Z," namely "^t" (i.e., a tab
character). The result would be that whenever a paragraph break is
followed by a number, the paragraph break instead becomes a tab
character while the number remains unchained.
Can this be done and, if so, how?
Thanks.
Ira
 
E

Elliott Roper

I'm using Office 2004 with Mac OS 10.4.11.
I would like to find "X" (a series of characters and/or format
instructions (like tab or paragraph), then replace "Y" (a subset of X)
with "Z" (which could be anything).
Currently, in a long list I am trying to find "X," namely "^p^# (i.e.,
a paragraph mark followed by any digit), and then replace "Y", namely
"^p" (i.e., the paragraph mark) with "Z," namely "^t" (i.e., a tab
character). The result would be that whenever a paragraph break is
followed by a number, the paragraph break instead becomes a tab
character while the number remains unchained.
Can this be done and, if so, how?
Thanks.
Ira

In general it is possible, but ^p is not valid with wildcards on.
Have a look at the notes at the bottom of the help item
"wildcard characters you can use while searching"
You could have used the (Newton) (Christie) construction if it were
anything but ^p and ^# and all their uncles and aunts in your search
string.

*SO*, a very evil way of doing it, would be first, (with wildcards off)
replace every ^p with && say.
Then turn wildcards on
find what: &&([0-9]{1,})
replace with: ^t\1
replace all
Then turn wildcards off again and change all the remaining && back to ^p

I *TOLD* you it was evil didn't I?

I think it might put everything in the same style, so do practice on a
copy if you have any clever formatting you want to keep.

PS. the same help item explains the [0-9]{1,} construction.
It is to get around no ^# with wildcards on, and also handles numbers
of any length. (err, the last bit is not needed in your case, I
outsmarted myself, any single digit would do for you)

Or you could do the whole thing with emacs and LaTeX without all the
hopeless broken regular expression syntax that Word's feeble
implementation forces upon you.

Or, since you have not yet downgraded to Office 2008, you could
possibly write a macro to do the job.

I have given up on Word, but sometimes I still drop in here and if
there is an interesting question, I'll try to mislead you <grin>
 
C

Clive Huggan

I have given up on Word, but sometimes I still drop in here and if
there is an interesting question, I'll try to mislead you <grin>

You have done us all a very good favour, therefore, Ira!

Clive Huggan
=============
 

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