I am reading a *.csv file into my program, but when the program finishes grabbing each field from the first row, it returns an EOF condition. Here is a snippet:
i = 1
while i <= lastRecord And Not exportError
Input #nFile(1), strRecord
If EOF(nFile(1)) Then
MsgBox "EOF on " & i & " read."
exportError = True
Else
Put #nFile(0), i, formatByte(strRecord)
end if
i = i + 1
Wend
After writing out the 124th field, I get the "EOF on 124 read." There are 124 delimited fields on the first row, and there are 38 rows total with approximately the same number of fields on each row. How do I keep reading through each row?
i = 1
while i <= lastRecord And Not exportError
Input #nFile(1), strRecord
If EOF(nFile(1)) Then
MsgBox "EOF on " & i & " read."
exportError = True
Else
Put #nFile(0), i, formatByte(strRecord)
end if
i = i + 1
Wend
After writing out the 124th field, I get the "EOF on 124 read." There are 124 delimited fields on the first row, and there are 38 rows total with approximately the same number of fields on each row. How do I keep reading through each row?