close

[Solved] Error: Unsupported format, or corrupt file: Expected BOF record

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Error: Unsupported format, or corrupt file: Expected BOF record in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Error: Unsupported format, or corrupt file: Expected BOF record Error Occurs?

Today I get the following error Error: Unsupported format, or corrupt file: Expected BOF record in python.

How To Solve Error: Unsupported format, or corrupt file: Expected BOF record Error ?

  1. How To Solve Error: Unsupported format, or corrupt file: Expected BOF record Error ?

    To Solve Error: Unsupported format, or corrupt file: Expected BOF record Error That's not a proper excel file, but an html readable with excel.

  2. Error: Unsupported format, or corrupt file: Expected BOF record

    To Solve Error: Unsupported format, or corrupt file: Expected BOF record Error That's not a proper excel file, but an html readable with excel.

Solution 1

You say:

The file doesn’t seem to be corrupted or of a different format.

However as the error message says, the first 8 bytes of the file are '<table r' … that is definitely not Excel .xls format. Open it with a text editor (e.g. Notepad) that won’t take any notice of the (incorrect) .xls extension and see for yourself.

Solution 2

Try to open it as an HTML with pandas:

import pandas as pd
data = pd.read_html('filename.xls')

Or try any other html python parser.

That’s not a proper excel file, but an html readable with excel.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read