- .txt, .dat, or .csv for delimited text files
- .xls, .xlsb, .xlsm, .xlsx, .xltm, .xltx, or .ods for spreadsheet files
readtable successful on .xlsx file but fails on .xlsb file
7 ビュー (過去 30 日間)
古いコメントを表示
readtable works fine reading an .xlsx file, but hangs when reading an .xlsb file.
The following works perfectly:
dat = "C:\DataDirectory\DataFile.xlsx";
T = readtable(dat);
I read in the documentation for readtable that for large Excle files reading the .xlsb format is recommended, so I saved the Excel file in .xlsb format and I tried:
dat = "C:\DataDirectory\DataFile.xlsb";
T = readtable(dat);
but this opens the Excel file and then freezes both Excel and Matlab. The only way to recover was to end the Excel process via TaskManager.
Matlab version is 2019b.
Excel version: Microsoft® Excel® for Microsoft 365 MSO (Version 2302 Build 16.0.16130.20374) 32-bit
I can continue to work with the .xlsx format, but I'm still curious if I'm doing something wrong, or if there is a known issue. It would be nice to use the .xlsb format if it in fact loads faster.
0 件のコメント
回答 (1 件)
Cris LaPierre
2023 年 5 月 4 日
編集済み: Cris LaPierre
2023 年 5 月 4 日
readtable determines the file format from the file extension:
How were your xlsb files created? Can you attach one to your post for others to test?
You might consider adding the 'UseExcel' flag.
dat = "C:\DataDirectory\DataFile.xlsb";
T = readtable(dat,'UseExcel',true);
3 件のコメント
Cris LaPierre
2023 年 5 月 4 日
If your information is confidential, then I suggest working directly with support. You can reach out to them here: https://www.mathworks.com/support/contact_us.html
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!