in reply to end of the line

It looks like your lines have CRLF line endings -- maybe you copied a Windows text file to a Unix host without ASCII conversion? You may need to strip these out before parsing.