Refs #9043 Dealing with line endings differently

I've been told about os.linesep so i'm using that instead, as well as suing a different way of checking for empty rows.