PS both your original code and the code that I've just posted will stop if a line contains the text "end" anywhere in it.

You shouldn't need this check at all if you want to read the entire file.

If this is the case, change
Code:
While Not @ERROR And Not InStr($Line,"end")


to just read
Code:
While Not @ERROR