json-to-csv icon indicating copy to clipboard operation
json-to-csv copied to clipboard

Python 3 CSV NewLine

Open frivollier opened this issue 7 years ago • 1 comments
trafficstars

In Python3 there is a know issue when writing line with csv lib. https://stackoverflow.com/questions/3348460/csv-file-written-with-python-has-blank-lines-between-each-row

I added newline ='' to the file open function to solve this.

Line 92 open(csv_file_path, 'w+',newline ='')

Thanks for sharing this code

frivollier avatar Feb 01 '18 16:02 frivollier

Yeah, and as that thread points out, this seems to be a windows only problem and you could also try opening the file in binary mode as opposed to text mode.

I see that this is your first issue... Great job!!

vinay20045 avatar Feb 01 '18 18:02 vinay20045