Azzera filtri
Azzera filtri

How do I import multiple excel files from multiple folders , with different names and sizes?

1 visualizzazione (ultimi 30 giorni)
Main folder has some n number of subfolders and these folders contain the excel files that I need to import to my program and store

Risposte (1)

Prajwal Venkatesh
Prajwal Venkatesh il 17 Gen 2020
clc;clear;
testfiledir = 'C:\Users\bidgu\OneDrive\Desktop\manpower';
matfiles = dir(fullfile(testfiledir, '*.xlsm'));
nfiles = length(matfiles);
datafi = cell(nfiles);
for i = 1 : nfiles
fid = fopen( fullfile(testfiledir, matfiles(i).name) );
datafi{i} = readtable(fid);
fclose(fid);
end
How do I use this code to read excel files?

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by