Search string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to add commas before the "and" in a string of terms, e.g., apples,
oranges, and bananas. The document is nearly 400 pages long. Sometimes the
commas is there and sometimes not, so I need to find the instances where it
is not and add it. Is there any way to search using wildcards for something
like this?

Thanks!
 
Sideways approach:

In Tools | Options, Spelling and Grammar, click on Settings under Grammar,
and you should be able to tell Word whether you want it to check for "comma
before last list item." If you set that as you like, then Word should catch
these when you run Tools | Spelling and Grammar and offer to fix them for
you.
 
Well it depends on exactly what you've got but this should give you
something to work with:

Find: (<[! ]{1,}>)( and <[! ]{1,}) - that's left parenthesis, left angle
bracket (less than sign), left (square) bracket, exclamation mark, space,
right bracket, left brace, one, comma, right brace, right angle bracket,
right parenthesis, left parenthesis, space, a, n, d, space, left angle
bracket, left bracket, exclamation point, space, right bracket, left brace,
one, comma, right brace, right parenthesis.

Replace: \1,\2 - that's backslash, one, comma, backslash, two
 
Another sideways approach:

1. Search for " and" and replace with ", and".

2. Then search for two commas and replace with one.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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

Back
Top