Link to home
Create AccountLog in
Avatar of zmau
zmau

asked on

Automating a manual procedure : Delete Block of lines within Search and replace

Hi!

I want to Search for a BeginString, and then delete the whole line which contains the BeginString.
Then I want to continue deleting lines until I reach an EndString (This line should stil be deleted).


Thanks zmau
Avatar of Patrick Matthews
Patrick Matthews
Flag of United States of America image

zmau,

Please elaborate on what you are trying to do.  For example, is this a VBScript that operates on one or more text files?  Or is it perhaps a VBA macro operating on a Word document or an Excel workbook?

In either case, example file(s) would be helpful.

Patrick
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of zmau
zmau

ASKER

Thanks for both of you.

Patrick,  these are text files. Actually, these file are Visual's *.dsp and *.dsw files. I just want to remove the VSS connection before I send the files to someone else.

billprew, this looks like it, except that the input file and Output file should be the same. I like your "clean" style. I will check it anyway...

Thanks again zmau.
==> billprew, this looks like it, except that the input file and Output file should be the same. I like your
==> "clean" style. I will check it anyway...

Let me know if that gives the desired result, we can adapt it to replace the original file.

~bp
Avatar of zmau

ASKER

This was the solution, except that the input file and Output file should be the same.
I've used another example, which I can not find now and got my solution.