7 replies
Is there any relationship between the old # and what the new # is? Since it's two companies, I doubt there is. If there isn't a relationship or rule, I do not see how this could be automated.
Post some more info. someone might have an idea.
Don
by khall3
by khall3
well i have a text file that is set up like this
00001.jpg, 12345.jpg
00002.jpg, 12346.jpg
00004.jpg, 98723.jpg
the numbers on the left of the comma are from one company and the numbers on the right are from the other company. so it must pull 00001.jpg and copy, rename, and move it to 12345.jpg in a different directory.
by nikki96
Sure.
Assume you have a text file, as yours is, with NO SPACES between the file names and the commas. Also, file names must be ABSOLUTE paths.
I tested this in VB6 and it worked fine. Replace the file name and path with yours.
Private Sub cmdCopy_Click()
Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0
Dim fs, f, ts, s, a
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFile("C:\Documents and Settings\me\My Documents\VBapps\imageCopy\list.txt")
Set ts = f.OpenAsTextStream(ForReading, TristateUseDefault)
While Not ts.AtEndOfStream
a = Split(ts.ReadLine, ",")
fs.CopyFile a(0), a(1)
Wend ts.Close
End Sub
by khall3
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending