I need to read a CSV file in python.
Since for last row I receive a \'NULL byte\' error I would like to avoid using for keyword but the while.
Do you know ho
Process the initial csv
file and replace the Nul '\0'
with blank, and then you can read it.
The actual code looks like this:
data_initial = open(csv_file, "rU")
reader = csv.reader((line.replace('\0','') for line in data_initial))
It works for me.
And the original answer is here:csv-contain null byte