I fixed the script to handle lines broken by \r rather than \n