Problem reading csv files

Ramashish Baranwal ramashish.lists at gmail.com
Fri Jan 4 05:24:07 CET 2008


Hi,

I am trying to read a csv file using csv.reader. The file is created
using Open Office and saved in Excel format.

import csv

reader = csv.reader(open('test.xls'))
for row in reader:
    print row

It however throws the exception _csv.Error:
<class '_csv.Error'>: line contains NULL byte

Any idea whats going wrong here?

Thanks in advance,
Ram



More information about the Python-list mailing list