read multiple excel files with different file names ?
显示 更早的评论
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.
回答(1 个)
KSSV
2020-8-27
xlFiles = dir("*.xlsx") ;
N = length(xlFiles) ;
for i = 1:N
thisFile = xlFiles(i).name ;
T = readtable(thisFile) ;
% do what you want
end
4 个评论
mukesh meharda
2020-8-27
KSSV
2020-8-27
You can use xlsread.Read the action.
mukesh meharda
2020-8-27
KSSV
2020-8-27
Put in a loop....idea is already given in the answer.
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!