How to read multiple excel files with pattern in their names
1 view (last 30 days)
Show older comments
As the title says, I want to read multiple excel files that have a pattern in their names.
The file names start from 1000 to 100000, increasing with an interval of 1000.
Thanks in advance.
0 Comments
Answers (2)
Bhaskar R
on 3 Nov 2019
% assuming working in the present working directory
files = 1000:1000:100000;
file_data = cell(1, length(files));
for iFile = 1:length(files)
% in string concatamatiom
% 1 - if filename has any pre string
% 2 - for loop varibale from 1000:1000:100000
% 3 - file extension
str = ['file_pre_string_if_any_', num2str(iFile), '.xlsx'];
file_data{iFile} = xlsread(str); % excel data will be stored in the variable file_data
end
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!