| || |
I read a text file which hold a list of numbers (20 numbers to be exact but can vary on future files),
E.g 1,2,3,4,5,6,8,...20 etc.
I would like to store each numbers into a dynamic array for later use where I can read them individually.
Here's the code to read the file
Dim fso, f1, ts, s
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.GetFile("C:\Documents and Settings\garifo\Desktop\InputNumbers.txt")
Set ts = fso.OpenTextFile("C:\Documents and Settings\garifo\Desktop\InputNumbers.txt", ForReading)
s = ts.ReadAll
I have tried it but I cannot figure it out. Any help will be greatly appreciated.
Split the contents of file using VBScript Split function in a dyanmic array:
arrNum = Split(strContents,",")
Thanks for your suggestion...got it working.