Phreeneazie
Technical User
HI all,
I'm back pleading with you guys for some more help! Regular visitors will know I'm completely dumb s'far as VB goes
I need to be able to delete a line of text in a file that contains the word "projected". It can appear anywhere on the line.
I have been looking at this script that was previously supplied to me for a different project and I'm sure that this is the way to go - but it needs slight modification...Can anyone help me out?! The script is:
As always, I'll be eternally grateful for any help!
Many thanks,
Neil.
I'm back pleading with you guys for some more help! Regular visitors will know I'm completely dumb s'far as VB goes
I need to be able to delete a line of text in a file that contains the word "projected". It can appear anywhere on the line.
I have been looking at this script that was previously supplied to me for a different project and I'm sure that this is the way to go - but it needs slight modification...Can anyone help me out?! The script is:
Code:
Const ForReading=1,ForWriting=2
Const myFile="C:\VBTesting\edmstest.txt"
Set fso=CreateObject("Scripting.FileSystemObject")
Set f=fso.OpenTextFile(myFile,ForReading)
a=Split(f.ReadAll,vbCrLf)
f.Close
Set f=fso.OpenTextFile(myFile,ForWriting,True)
For i=0 To UBound(a)
If Left(a(i),1)<>"projected" Then f.WriteLine a(i)
Next
f.Close
As always, I'll be eternally grateful for any help!
Many thanks,
Neil.