Reading a 97-2003 xls file

조회 수: 11 (최근 30일)
C
C 2019년 7월 12일
답변: Sohel Rana 2021년 12월 9일
How can I read a 97-2003 xls file into matlab. It gives me the error "not in Microsoft Excel Format"
If I resave the file as a newer verson I can read that but I have thousands of files I need to read and I can't go through manually changing each one.
Thank you.
  댓글 수: 7
Ayushman Tripathi
Ayushman Tripathi 2020년 8월 12일
편집: Ayushman Tripathi 2020년 8월 12일
I was facing the same issue("not in Microsoft Excel Format") as you were while reading .xls file (1997-2003 Excel)
I came across the following link which helped resolve the issue .
In short, you can use the dlmread OR readmatrix command on MATLAB. It worked for me.
Rik
Rik 2020년 8월 12일
Judging by the description there I wouldn't say it is actually an Excel file, so the error is correct. A tab delimited file is not an xls.

댓글을 달려면 로그인하십시오.

답변 (2개)

Rik
Rik 2019년 7월 15일
Sometimes it helps to provide the full file name including the extension. That way Matlab doesn't have to determine the file type on its own.
  댓글 수: 1
dpb
dpb 2019년 7월 15일
+1 I missed that detail and would definitely never pass an unqualified name w/o extension to xlsread. In fact, I'd expect it to fail with "file not found" and think opening a file that could possibly be different than the one passed by name verging on the edge of being a bug.

댓글을 달려면 로그인하십시오.


Sohel Rana
Sohel Rana 2021년 12월 9일
You could use file extension.
Use xlsread ('filename.xls') instead of xlsread ('filename.xlsx') for 97-2003 xls file.
It worked for me.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by