For whatever reason, I think that particular log file starts each entry with a CRLF, and ends it with just null. So you can just discard the first line, or perhaps any blank line. Also, make sure to test for eof() after processing the line, otherwise you may fail to process the last line.