I have a file called Some.csv which has a field (column) which has values like
1000, 2000, .... 39000.
I wanted only the files with 39000 so I wrote the following python script
import os
import csv
with open('Somenew.csv', 'w') as fw:
writr = csv.writer(fw, delimiter=',')
with open('Some.csv','r') as fr:
reader = csv.reader(fr, delimiter = ',')
for row in reader:
if row[2] == '39000': writr.writerow(row)
Now when this executes on Windows it Somenew.csv looks like this
xxxx, xxxx, 39000, xxxx, xxxx
yyyy, yyyy, 39000, yyyy, yyyy
But when executing on Linux (Ubuntu 14.04LTS) there is no extra newline added.
Is there any reason for this? Is it perhaps because of the compiler?