How do I find an empty line, in a CSV file, that looks like this ',,,,,,,,,,,,,,,,,,\n' with python's ReadLine().
I want to write something like this:
file = 'file.csv'
f = open(file, mode='r', encoding='utf8')
while f.readline() != '\n' or f.readline() != ',,,,,,,,,,,,,,,,,,\n':
pass
df = pd.read_csv(f, header=None)
f.close()
The or f.readline() != ',,,,,,,,,,,,,,,,,,\n': is not identifying the line that looks like this ',,,,,,,,,,,,,,,,,,\n'
I felt that would work when running f.readline() manually in my notebook over and over until I got to the first "blank" line. Then the output looked like ',,,,,,,,,,,,,,,,,,\n' and I thought surely that would pick it up. Needless to say it did not.
,,,,,,,,,,,,,,,,,,lines?,,,,,,,,,,,,,, random. You'll see I have accepted the answer but I still don't understand these additional commas.