I have a machine that saves files using machine information which really is quite random.
What i want to do is move and rename these files sequentially. I have done that, but my code does not do it based on the time the files were saved and I'm stumped.
I want to save the files (.prn - text files) as 1.prn, 2.prn, 3.prn etc. based on 1.prn being the first the machine wrote. Right now it seems to be a random order, I have not looked, but maybe alphabetical ...
I appreciate any help you can give me.
FC
Here is what I have (it is a snippet,so some variables will not make sense here):
vb Code:
spath = "c:\program files\outputprn\" spattern = "*.prn" Set cFiles = New Collection 'get the files to be renamed sFile = Dir$(spath & spattern) Do While Len(sFile) > 0 If (sFile <> "." And sFile <> "..") Then cFiles.Add sFile End If sFile = Dir$() Loop 'rename the files For iFile = 1 To cFiles.Count Name spath & cFiles.Item(iFile) As newpath & Format$(cFiles.Item(iFile), "0") Next iFile




Reply With Quote