Searching for the paragraph style certainly was simple. But
searching for numbers could be very useful to me in a different
context, so I set to work with it so I could learn how to better use
Find & Replace. I found 2 problems to ask you about:
1. At first it found all instances of numbering, e.g. "2.->" (I'm
using -> to represent the tab character here), "3->" etc. But it
also found all the subparagraph numbering, such as "A->", "B->" etc. I
fixed this by adding the Style "Rog label" to the Find What line
and then it worked. But if the stuff I was looking for did not
aleady have a unique style (somebody on my staff apparently spent a
lot of time manually applying the different level styles to each
paragraph and its subparts--way too much time, if this sort of thing
can be done using Find & Replace), the search would have been way
over-inclusive. Is there a way to limit the search to numbers?
2. The Find & Replace stumbled when it got to 2-digit numbers. I put
"xxx\1" in the Replace With line. From paragraphs 1-9 I got
"xxx1.->", xxx2.->" etc. Fine result. But starting with paragraph
10 it became "1xxx0.->", "1xxx1.->", "1xxx2.->", which obviously is
not what you had in mind. Is there a way to have the text to be
inserted added ahead of the first of the digits?
[A future challenge will be how to use Find & Replace to do something
with an entire paragraph which starts with, say, this sort of
numbering. But first things first]
FYI we do not create the Word files for which Find & Replace might be
helpful. They are formal interrogatories in legal proceedings
prepared by opposing lawyers for which we prepare formal legal
responses for our clients. For a lot of reasons we want the
questions and answers together in the final response, in a format we
can easily control. Sometimes these are sent to us by others as Word
files, but with no formatting beyond using a bunch of tabs (or
spaces) to create indented sub-paragraphs. Most of the time we get
the files as paper or PDFs and have to convert them to Word, a
headache in its own right.
Graham Mayor said:
A wildcard search for
([0-9]{1,2}^t)
will find all one or two digit numbers followed by a tab
replace with
xxx\1
or search for your paragraph style ie put nothing in the search box
and set format style Rog label
and in the replace box clear formatting and put
xxx^&
as the replace string. (no wildcards) This will add xxx to the start
of any paragraph in that style.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Joe said:
How can I construct a search to find all instances of paragraphs
numbered from 1-44 (e.g., "39. plus a tab")and insert a paragraph
ahead of each with a fixed string of characters, like "xxx" for use
as a marker? Of course I want to leave those paragraph numbers
intact. Each of the paragraphs numbered 1-44 has a unique style
(Rog label) and lots of indented subparagraphs each with a unique
indented style depending on the level (e.g., Indent 1, Indent 2,
etc.). I have struggled with Graham Mayor's paper on wildcards but
I can't seem to get to first base. Once I have the xxx in place I
can do more searching and replacing without recourse to wildcards.