I am sure this is something simple, but I haven't done this type of stuff in quite some time. I am trying to open one file, read it, put line by line info into an array. Then, I want to clean up the data and dump it to a new file. The code I am including is my basic's that i'm starting with. I cannot get the "f = fso.OpenTextFile" to cooperate at all. If I try to add the "ReadOnly, True" arguments, I get errors. The "f.AtEndOfString" doesn't appear to be working either. Please offer some direction to get me going a bit further. I appreicate everything.
As a note, I'm using VBScripting. I would like to stay with that if at all possible. The originating data file is a txt file.
Dim fso, f, f2, lineNum(), cnt, i, ii
ii = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("c:\temp.txt")
Do while not f.AtEndOfString
ReDim Preserve lineNum(ii)
lineNum(ii) = ii
ii = ii + 1
Set f2 = fso.CreateTextFile("C:\disabled.cvs")
For each i in lineNum
Set f = Nothing
Set f2 = Nothing
Set fso = Nothing