Effacer les filtres
Effacer les filtres

read multiple excel files with different file names ?

4 vues (au cours des 30 derniers jours)
mukesh meharda
mukesh meharda le 27 Août 2020
Commenté : Stephen23 le 27 Août 2020
I want to multiple excel files with different file names like R1 (1).xlsx, R1 (2).xlsx, R1 (3).xlsx........... till R1 (30).xlsx and want to extract data having same sheet name and column number in each excel files. lets say Sheet name is "ABC" in each excel file and want to extract column T and U from this sheet from all the sheets.

Réponses (1)

KSSV
KSSV le 27 Août 2020
xlFiles = dir("*.xlsx") ;
N = length(xlFiles) ;
for i = 1:N
thisFile = xlFiles(i).name ;
T = readtable(thisFile) ;
% do what you want
end
  4 commentaires
mukesh meharda
mukesh meharda le 27 Août 2020
then I have to write this 30 times for each excel files
KSSV
KSSV le 27 Août 2020
Put in a loop....idea is already given in the answer.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by