How to delete the first line of a large CSV file in python? Here I reviewed previous solutions:
with open("test.csv",'r') as f: with open("updated_test.csv",'w') as f1: f.next()
which gave me this error:
f.next() # skip header line AttributeError: '_io.TextIOWrapper' object has no attribute 'next'
another solution was:
with open('file.txt', 'r') as fin: data = fin.read().splitlines(True) with open('file.txt', 'w') as fout: fout.writelines(data[1:])
What causes a memory problem!
source share