Spreadsheet (.xls) not fully loading

I'm importing a spreadsheet using
[data header] = xlsread(filename);
, but only the first 438 rows (13 elements/row) is imported. The file is 1500 rows long. Why isn't the entire file imported? What's imported is only 438*13*8 = 45kb, so clearly it's not a memory limitation...or is it? I'm running Ubuntu 12.04 64-bit, matlab 2014a, so the 'memory' command doesn't work.

2 件のコメント

dpb
dpb 2014 年 8 月 7 日
More than likely there's something bum in the file at that point
Star Strider
Star Strider 2014 年 8 月 7 日
Can you open it in Excel?
If so, is there anything strange in or after row 438?

サインインしてコメントする。

回答 (2 件)

John
John 2014 年 8 月 7 日

0 投票

There isn't anything strange in the file, i wrote the lines manually in LibreOffice calc. See attachment.

5 件のコメント

Star Strider
Star Strider 2014 年 8 月 7 日
編集済み: Star Strider 2014 年 8 月 7 日
This:
[num,txt,raw] = xlsread('dataTest.xls');
creates a (1714x13) double array for me in num and reads the text headers correctly in txt.
I can’t reproduce your error (Win 8, R2014a). I can only verify that it reads past line 438 and I assume reads in everything. (I didn’t scroll down to the end of the rows when I opened it in Excel to check that line for potential problems.)
John
John 2014 年 8 月 7 日
Interesting. It only loads a 438x13 matrix for me, no matter how many times i try.
Star Strider
Star Strider 2014 年 8 月 7 日
See if one of the other functions like textscan will work. The Data Import Wizard in the ‘VARIABLE’ secton of the main MATLAB toolbar is another option. Once you get it in your workspace the way you want it, save it as a ‘.mat’ file.
dpb
dpb 2014 年 8 月 7 日
Then probably it's related to not having Excel operating on the platform and the limits of the "basic" mode. You can always report bug and supply the file to TMW at www.mathworks.com and see if they can provide a workaround. Otherwise, as others have said, it would seem if you must use a spreadsheet as the generator you're limited to a text file interchange format. That the file seems to work on a Windows platform that (I presume) has Excel installed is what makes me think the "basic" mode issue is likely the problem.
Oh, can you try to remove and extra features or maybe functions/formulas and see if that helps? Save values only to another spreadsheet, maybe?
Kelly Kearney
Kelly Kearney 2014 年 8 月 7 日
編集済み: Kelly Kearney 2014 年 8 月 7 日
I see the same behavior as John; biffparse (the basic xls reader) is returning NaNs at line 440 and fails to read beyond that. Not sure why, since biffparse is a mex file. Matlab 2013a on Mac OS X 10.9.3.
And in reply to the comment below, when not on Windows, reading from text files is always more stable (and usually quicker) than reading from Excel files. If your files are tab-delimited, just use dlmread or textscan.

サインインしてコメントする。

azizullah khan
azizullah khan 2014 年 8 月 7 日

0 投票

Save these files as CSV format
and use csvimport it will be better....
Or which type of OP system you are using?

1 件のコメント

John
John 2014 年 8 月 7 日
As mentioned in the original post, Ubuntu 12.04 64-bit, matlab 2014a. How is cvsimport() better than xlsread()? And if the actual raw files are TSV (tab separated) is there a better way to do import them?

サインインしてコメントする。

製品

質問済み:

2014 年 8 月 7 日

編集済み:

2014 年 8 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by