How to reduce the time of reading an excel spreadsheet
1 view (last 30 days)
Show older comments
I am trying to read an excel spreadsheet which has about 25 tabs. Each tab has string and numeric data. Ideally, data in each tab is stored in a separate matrix. I only need data from columns A:H of each tab and for unknown number of rows. If I do the following:
[~, tabs, ~] = xlsfinfo([handles.pathname, Filename]);
ntabs = length(tabs);
for i = 4:ntabs
Name = tabs{i};
tic
[~,~,raw] = xlsread([handles.pathname , Filename, Name];
toc
NF(i-3).Name = Name;
NF(i-3).Data = raw(7:end, 1:8);
end
each iteration (between tic toc) takes about 4.5 secs for each tab. A total of 25 tabs take 112sec
after changing the line
[~,~,raw] = xlsread([handles.pathname , Filename, Name];
to
[~,~,raw] = xlsread([handles.pathname , Filename, Name, 'A:H');
each iteration take now 6.4 secs. increasing the total time to 160 secs.
Any help on reducing the time taken for each iteration, is greatly appreciated. Thanks a lot in advance!
0 Comments
Answers (0)
See Also
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!