Computing.Net > Forums > Programming > vbscript to parse text file and com

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

vbscript to parse text file and com

Reply to Message Icon

Original Message
Name: shafiq1
Date: July 17, 2008 at 06:52:53 Pacific
Subject: vbscript to parse text file and com
OS: xp sp2
CPU/Ram: core2 duo 2g
Model/Manufacturer: dell
Comment:

I'm trying to write a vbscript that will parse a text file line by line. if the contents of each line matches the filename of an actual file in another directory, then the file in the directory will be copied to another location.



Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: July 21, 2008 at 17:49:21 Pacific
Reply: (edit)

Set fso = CreateObject("Scripting.FileSystemObject")
With fso.OpenTextFile("a text file", 1)
On Error Resume Next
Do Until .AtEndOfStream
fso.CopyFile "another directory\" & .ReadLine, "another location\"
Loop
End With


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software