Python Forum
CSV gives me blank row on PC, but not a Mac
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CSV gives me blank row on PC, but not a Mac
#3
As stated in the docs:
Quote: If csvfile is a file object, it should be opened with newline=''.
and the footnote:
Quote:If newline='' is not specified, newlines embedded inside quoted fields will not be interpreted correctly, and on platforms that use \r\n linendings on write an extra \r will be added. It should always be safe to specify newline='', since the csv module does its own (universal) newline handling.

That's exactly the case with Windows where lineendings are \r\n
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
RE: CSV gives me blank row on PC, but not a Mac - by buran - Jan-06-2020, 08:40 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020