1

I am trying to use xlsread functioin to read spreadsheets of 6000x2700 (xlsx file).

I have two questions:

First, when I use something like

[num,txt,~]=xlsread(input_file,input_sheet,'A1:CYY6596')

Matlab keeps showing 'busy' and lose response (while I can open it in excel within 30 seconds).

Is there any solution If I don't want to loop through ranges of the xlsx file? In other word, can I just dump spreadsheet of this size into matlab using xlsread?

Alternatively, Maybe I can use loops to read these files range by range, but I cannot identify the last column of each of the spreadsheets unless I read the whole file first. Therefore, If I cannot identify the last column, it is hard to make loops and do my interpretation on the file.

So My second questions is: Is there a way to identify the last column of the spreadsheet without reading the whole spreadsheet?

Thanks.

EDIT:However, if I run a similar code which only reads first 400 columns ('A1:RY6596') of the spreadsheet, such problem doesn't happen.

  • this is a low tech solution, but if xlsread isn't working well on this file, you may want to use Excel to save the .xlsx file as a .csv file and then import that with Matlab. – Matthew Gunn Apr 15 '16 at 05:00
  • Thanks for the answer. I tried with the csv file, but Matlab still lose response (after a while, stay occupying 0% cpu and a unchanged memory ). – Cognitive Easer Apr 15 '16 at 07:16

2 Answers2

1

which version of matlab you are using? matlab has a problem to load bix excell file. convert the excell in csv and use M = csvread(filename). You can try to convert .xlsx into .xls also.

  • I am using R2015b. To my knowledge, csvread only read numbers, right? However, I also want to read strings in the spreadsheet. Is that applicable? Anyway, I would like probably give it a try first. Thanks. – Cognitive Easer Apr 15 '16 at 08:16
  • I've tried csvread. But it cannot read and give error: "Mismatch between file and format string.Trouble reading 'Numeric' field from file ". I also doubled checked the documentation of csvread and pretty sure that it cannot read non-numeric data while mine has a lot in the spreadshseets. – Cognitive Easer Apr 16 '16 at 02:28
0

You can Try the tool in File Exchange

  • Thanks for that and I can tell it can read both text and number. I've already separated the spreadsheets to 5-6 parts each and the problem for me is already solved. Anyway, thanks for the tool and It may help me or others one day. – Cognitive Easer Apr 17 '16 at 07:55