Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Removed pleasantries; added link to comment
Source Link
cigien
  • 61.2k
  • 11
  • 86
  • 124

Answer from @JerryJeremiahJerry Jeremiah's comment

Your CSV file was made on Windows and has Windows line endings. But yhe computer you are running this on uses UNIX style line endings so each line in the CSV has a \r at the end that is not being removed. There are multiple ways of removing the \r from the CSV file - or you could even do it inside this program after reading the data.

Took it into notepad++, edited the newlines to be just LF, and that fixed it.

Thanks!

Answer from @JerryJeremiah

Your CSV file was made on Windows and has Windows line endings. But yhe computer you are running this on uses UNIX style line endings so each line in the CSV has a \r at the end that is not being removed. There are multiple ways of removing the \r from the CSV file - or you could even do it inside this program after reading the data.

Took it into notepad++, edited the newlines to be just LF, and that fixed it.

Thanks!

Answer from Jerry Jeremiah's comment

Your CSV file was made on Windows and has Windows line endings. But yhe computer you are running this on uses UNIX style line endings so each line in the CSV has a \r at the end that is not being removed. There are multiple ways of removing the \r from the CSV file - or you could even do it inside this program after reading the data.

Took it into notepad++, edited the newlines to be just LF, and that fixed it.

Source Link
Pingu21
  • 181
  • 1
  • 4

Answer from @JerryJeremiah

Your CSV file was made on Windows and has Windows line endings. But yhe computer you are running this on uses UNIX style line endings so each line in the CSV has a \r at the end that is not being removed. There are multiple ways of removing the \r from the CSV file - or you could even do it inside this program after reading the data.

Took it into notepad++, edited the newlines to be just LF, and that fixed it.

Thanks!