I got a text file like this.
BeginWord, Word1, Word2, Word3, Word4, Word5, Word6
Word, Word1, Word2, Word3, Word4, Word5, Word6
Word, Word1, Word2, Word3, Word4, Word5, Word6
End
I want to read the whole file and only get the first word and the last word of each line, but when my code reaches the last line I get an error (OutofBound??) due to "End" in an Array of 0-6.
My code is not finished but you kind of get what I mean.
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile("c:\Read.txt", ForReading)
Do Until objTextFile.AtEndOfStream
strNextLine = objTextFile.Readline
arrServiceList = Split(strNextLine , ",")
output = output & "Process name: " & arrServiceList(0) & "QUE Length: " & arrServiceList(6) & vbCrLf
Wscript.Echo output
Loop