Link to home
Start Free TrialLog in
Avatar of Mr_Shaw
Mr_Shaw

asked on

vbscript edit text file

I have 61 text files in a directory.

Each text file includes the phrase "Use [db1]".

Is it possible to create a vb script which loops through each text file and deletes this phrase?

 
Avatar of Bill Prew
Bill Prew

Does it literally say [db1], or are there different names in the brackets?

Can you provide a sample file for testing?

~bp
Avatar of Mr_Shaw

ASKER

The files are SQL scripts.. an example would be:

Use [db1]

select * from dbo.tb1
Avatar of Mr_Shaw

ASKER

I need to remove the Use [db1] so that I migrate a set of stored procedures to a new schema.
Avatar of Mr_Shaw

ASKER

I have 625 files which i need to remove "Use [db1]"
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Shaw

ASKER

Thanks for your help....

When I runt the script I get an eror:

Line: 11
Char : 4
Error: Input past end of file
Code 800A003E
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Shaw

ASKER

thanks
Welcome.

~bp