f.readlines() would read all lines in the file and put the into a list.
so you could do it like:
Code: Select all
f = open('/sd/data/data5.csv')
content = f.readlines()
f.close()
for data in content:
u2.write(data.rstrip("\n"))
Code: Select all
f = open('/sd/data/data5.csv')
for data in f:
u2.write(data.rstrip("\n"))
f.close()