3

I am working on the excel processing using python.
I am using xlrd module (version 0.6.1) for the same.

I am abe to fetch most of the excel files but for some excel files it gives me error as :

XLRDError: Expected BOF record; found 0x213c

Can anyone let me know about how to solve this issue?
thanks in advance.

2
  • Googling this exact error suggests these '.xls' files are not in Excel 2003 'binary' format but are xml-based (newer excel file format). You van verify by opening one in notepad. Are you sure you're using the latest XLRD version? Commented Apr 24, 2012 at 7:06
  • I am not using latest xlrd modules as our project is working with version 0.6.1 Commented Apr 24, 2012 at 7:06

1 Answer 1

5

What you have is most probably an "XML Spreadsheet 2003 (*.xml)" file ... "<!" aka "\x3c\x21" (which is what XML streams start with) is being interpreted as the little-endian number 0x213c.

Notepad: First two lines:

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>

You can also check this by opening the file with Excel and then click on Save As and look at the file-type that is displayed. While you are there, save it as an XLS file so that your xlrd can read it.

Note: this XML file is NOT the Excel 2007+ XLSX file. An XLSX is actually a ZIP file (starts with "PK", not "<?") containing a bunch of XML streams.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.