Posted on 2006-04-24
I am not sure deleting these files is what I need to do but it will also accomplish the task... If you can think of another way to do this then that would help too... Ok here is what I am trying to do...
the fname selects all the files in the directory that the first 11 characters are so and so and then it updates my database (I did not include the updating of the database part) well in those files there are some files that I do NOT want to update the database with... those files have the last 5 characters of "inj-r" , "ros-r" , "log-r".... SO I need to build an IF statement that deletes the files before it goes through them to update it or to find away to disregard them in the process. Can someone give me an idea of how to do this or point me in the right direction with some examples so I can figure this out. I am very new at this whole vb script thing.
Set objFolder = objFSO.GetFolder("C:\SportsTicker\xmlfiles\")
For Each file in objFolder.Files
Set objTextStream = objFSO.OpenTextFile(objFolder & "\" & file.Name)
fname = left(file.name,11)
if fname = "BC-BBA-PRVW" or fname ="BC-BBN-PRVW" or fname ="BC-BBM-PRVW" or fname ="BC-BBA-RCPS" or fname = "BC-BBN-RCPS" or fname ="BC-BBM-RCPS" or fname ="BC-BBA-LGNS" or fname ="BC-BBN-LGNS" or fname ="BC-BBM-LGNS" then
Do While Not objTextStream.AtEndOfStream
if j > 0 then
objXMLDOM.async = False
If Not objXMLDOM.Load("C:\SportsTicker\xmlfiles\" & file.name) Then