Closed cschloer closed 4 years ago
xls_problem.xls.txt Here's the file - just make sure to remove the .txt ending
Hi @cschloer,
the file works fine with tabulator
:
from tabulator import Stream
with Stream('tmp/issue301.xls', sheet='Fig. 1') as stream:
print(stream.read())
# [['Year', 'Month', 'Site', 'Coral cover %', 'SE coral cover', 'Lobe density mean', 'SE lobe density', 'N quadrats', 'Mean lobe size (cm)', 'SE lobe size (cm)', 'N (lobes)'], [1988, 3, 'Tektite', 32.8, 2.8, 35.8, 6, 30, 67.8, 2.94, 805], ...]
I think the problem that you need to set xls
format or not to specify format at all (will be detected). And it looks like here - https://github.com/BCODMO/laminar-web/issues/464 - xls
and xlsx
are merged as one format.
Please re-open if it didn't help
So what I mean:
with Stream('tmp/issue301.xls') as stream: # good
with Stream('tmp/issue301.xls', format='xls') as stream: # good
with Stream('tmp/issue301.xls', format='xlsx') as stream: # error
thanks, that worked!
Overview
I'm somewhat confused by this because I've seen XLS files work before. Maybe it's just an older version of the filetype that isn't supported.
I will share the file as soon as I get permission to release it into the public
Running a pipeline that uses tabulator with a xls file returns the error:
When I tried inside the python interpreter to use openpyxl library to load the file from path I got the more clear error:
Can we update the XLSX parser to fall back to xlrd when it's an XLS file?
Please preserve this line to notify @roll (lead of this repository)