How can i read all the lines of a text file into an array, using vbscript ?

please advise
itbabeAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Patrick MatthewsConnect With a Mentor Commented:
Quite simple, really:



Dim fso, ts, arr

Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.OpenTextFile("c:\file.txt")
arr = Split(ts.ReadAll, vbCrLf)
ts.Close
Set ts = Nothing
Set fso = Nothing

' Now do something with the array

Open in new window

0
All Courses

From novice to tech pro — start learning today.