Replace text strings with VBA

R

Ross

Hi,
I have a 200 page server list containing text similar to that below. I need
to delete the text between the last asterisk after "Version" up to the phrase
"Exclude Lists"
I have looked all over but no joy. Can anyone help?
thanks,
Ross
**********************************************************
Host:w2kserver
Operating System:Windows2000 5
Machine Type:Windows
Host Type:Client
Version:5.1
**********************************************************
Universal Settings

Restore retries: 0
Browse timeframe for restores 0 days
Required network interface

Exclude Lists
 
G

Greg

Ross,

You don't really need VBA for this. You can do it with a wildcard
search and replace.

Find: (\*[1,})*(Exclude List)

Replace with \1^13\2
 
K

Klaus Linke

Greg said:
Ross,

You don't really need VBA for this. You can do it with a wildcard
search and replace.

Find: (\*[1,})*(Exclude List)

Replace with \1^13\2


Hi Greg, Ross,

There's a typo -- [ instead of { -- and the * wildcard is pretty dangerous
(it will match everything from the first asterisks it encounters onward).
Also, ^13 should better not be used in "Replace with" (because it won't put
in a real paragraph mark).

Better, I think:
Find what: (\*)[!\*]@(Exclude List)
Replace with: \1^p\2

Hope this will do the trick,
Klaus
 
R

Ross

Many thanks for your assistance, this has opened up an incredibly useful set
of tools.
Ross
 
R

Ross

Many thanks for your assistance, this has opened up an incredibly useful set
of tools.
Ross
 

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