XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'

J.O. Aho user at example.net
Wed Sep 29 05:40:38 EDT 2021


On 29/09/2021 10.22, hongy... at gmail.com wrote:
> I tried to convert a xls file into csv with the following command, but failed:
> 
> $ in2csv --sheet 'Sheet1'  2021-2022-1.xls
> XLRDError: Unsupported format, or corrupt file: Expected BOF record; found b'\r\n\r\n\r\n\r\n'
> 
> The above testing file is located at here [1].
> 
> [1] https://github.com/hongyi-zhao/temp/blob/master/2021-2022-1.xls
> 
> Any hints for fixing this problem?

You need to delete the 13 first lines in the file or you see to that 
your code does first trim the data before start xml parse it.

-- 

  //Aho


More information about the Python-list mailing list