필터 지우기
필터 지우기

read multiple excel files with different file names ?

조회 수: 4 (최근 30일)
mukesh meharda
mukesh meharda 2020년 8월 27일
댓글: Stephen23 2020년 8월 27일
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
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
mukesh meharda 2020년 8월 27일
then I have to write this 30 times for each excel files
KSSV
KSSV 2020년 8월 27일
Put in a loop....idea is already given in the answer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by