Well, there's a lot of code that will read a spreadsheet, but there's probably nothing that you can just blindly throw at the particular problem.
But, it's not hard problem to solve if the spreadsheets are reasonably regular in their format.
Just read each file into a an array and select the rows desired--if it is truly random selection, then something like
d=dir('AppropriateWildCardString.xls*');
for i=1:length(d)
[~,~,raw]=xlsread(d(i).name);
if i==1
ix=randperm(size(raw,1),1000);
data=raw(ix,:);
else
data=[data raw(ix,2:end)];
end
end
At that point you'll have cell array of the desired data; I'd recommend converting to table and storing the data in appropriate variable types (double, string, categorical, ...) based on its characteristics.
Best Answer