I have compiled data of about 200 excel sheets and need to add the file's name before each of the data sets. How can I do this easily? My code so far is:
clear allclose allds = spreadsheetDatastore('C:\Users\Control', 'IncludeSubfolders', true);idx = [];for i=1:length(ds.Files) if strfind(ds.Files{i},'Inflections') idx=[idx;i]; endendds.Files = ds.Files(idx);data=ds.readall();writetable(data, 'masterexcelfile_DR.xlsx');
Best Answer