ファイル全体を読み取るのではなく、行をループします
http://techsupt.winbatch.com/ts/T000001033F64.html
:test4
; read single chars from a line, count chars.
testfile = "d:\temp\test.ascii.txt"
MyFile = fso.OpenTextFile(testfile, ForReading) ; Open a file as a TextStream
ThisLine = ""
While !MyFile.AtEndOfLine ; Is the current position at the end of a line?
ThisColumnCount = MyFile.Column ; Current column number.
ThisLine = StrCat(ThisLine, MyFile.Read(1)) ; Read a specific number of characters into a string.
NextColumnCount = MyFile.Column ; Current column number.
EndWhile
MyFile.Close ; Close a text stream.
ObjectClose(MyFile)
:test5
; read lines, count lines.
testfile = "d:\temp\test.ascii.txt"
MyFile = fso.OpenTextFile(testfile, ForReading) ; Open a file as a TextStream
While !MyFile.AtEndOfStream ; Is the current position at the end of the stream?
ThisLineCount = MyFile.Line ; Current line number.
ThisLine = MyFile.ReadLine ; Read an entire line into a string.
NextLineCount = MyFile.Line ; Current line number.
EndWhile
MyFile.Close ; Close a text stream.
ObjectClose(MyFile)