Pankaj Parashar
Pankaj Parashar

Reputation: 10232

Unable to read .xls file in python using xlrd

My Code -

import xlrd
xlrd.open_workbook('H:\DataSync\Projects\CV_Rec\Feed.xls')

Error -

Traceback (most recent call last):
XLRDError: Unsupported format, or corrupt file: Expected BOF record; found 'PK\x03\x04\x14\x00\x06\x00'
File "D:\ATHENA~1\RELEAS~1\build\ext\noarch/pylib\site-packages\xlrd\__init__.py", line 1545, in getbof
File "D:\ATHENA~1\RELEAS~1\build\ext\noarch/pylib\site-packages\xlrd\__init__.py", line 1539, in bof_error

Can anybody help me with this?

Upvotes: -1

Views: 765

Answers (1)

Pankaj Parashar
Pankaj Parashar

Reputation: 10232

OK..I found the problem! The person from where I got this excel sheet had renamed the original file from 'Feed.xlsx' to 'Feed.xls'.

This is the reason for the corrupt file.

Upvotes: 1

Related Questions