Deleting the second instance of a word in a repeating sequence

N

Nexan

I'm trying to figure out how to create a macro that will eliminate the second
instance of a word in a repeating list of words. It looks something like this:

CITY: (variable text)
STATE: (variable text)
PHONE: (variable text)
TIME TO CALL: (variable text)
REASON: (variable text)
STATE: (variable text)
Q11B TEXT: (variable text)

CITY: (variable text)
STATE: (variable text)
PHONE: (variable text)
TIME TO CALL: (variable text)
REASON: (variable text)
STATE: (variable text)
Q11B TEXT: (variable text)

How can I create a macro to eliminate only the second instance of "STATE:
(variable text)"?
 
G

Greg Maxey

Nexan,

You don't need a macro. You can use Find and Replace with wildcards.

Find: (REASON:*^l)(STATE:*^l)(Q11B TEXT:*^l)
Replace with: \1\3

Note if your lines are broken with paragraphs vice linebreaks then use ^13
instead of ^l
 

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