> Set objFSO = Nothing- Hide quoted text -
>
> - Show quoted text -
If you'd posted that someone could have pointed out that you weren't
parsing the data file into the array and that there was nothing inside
your FOR loop. Corrected, it would look something like this ...
Option Explicit
Dim objFSO, strTextFile, strData, strLine, aLines, a
CONST ForReading = 1
strTextFile = "confirm.csv"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set a = objFSO.CreateTextFile("confirm_extract.txt")
strData = objFSO.OpenTextFile(strTextFile,ForReading).ReadAll
aLines = Split(strData, vbNewline)
For Each strLine in aLines
a.WriteLine mid(strLine,2)
Next
So, you were actually pretty close to a working script, though the
errors were pretty fundamental.
BTW, I left out the 'clean up' because a script does that
automatically when it exits. The only time it 'might' be needed is if
you have big data structures and find that you are running out of
memory to run a later part of the script.
I said 'might' because such a memory hog of a script is very
unlikely. If the job is that big, scripting is probably the wrong
tool.
__________________________
Tom Lavedas