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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

vbscript to parse text file and com

Reply to Message Icon

Name: shafiq1
Date: July 17, 2008 at 06:52:53 Pacific
OS: xp sp2
CPU/Ram: core2 duo 2g
Product: 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.




Sponsored Link
Ads by Google

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

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


0
Reply to Message Icon

Related Posts

See More







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


Sponsored links

Ads by Google


Results for: vbscript to parse text file and com

batch file to parse text file www.computing.net/answers/programming/batch-file-to-parse-text-file/18030.html

batch script to parse text file www.computing.net/answers/programming/batch-script-to-parse-text-file/16793.html

add line numbers to a text file www.computing.net/answers/programming/add-line-numbers-to-a-text-file/16840.html