how to run multiple xlsx files once
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
I have a code which use one xlsx file from source folder, analyzes it and creates file into destination folder.
I would like to use this code as it is, but use multiple xlsx files at once at the source folder, and creates all new files at once into the destination folder.
thanks
댓글 수: 1
Alex Mcaulley
2019년 10월 31일
Without more details, you will need a loop to call the function for each file
답변 (1개)
galaxy
2019년 10월 31일
You can use following steps:
% select path
work_path = uigetdir('pwd', 'Select folder');
% find all xlsx files in folder
% findfiles function can get in: https://www.mathworks.com/matlabcentral/fileexchange/172-findfiles
work_files = findfiles('*.xlsx', work_path);
num_file = length(work_files);
for cnt_file=1:num_file
%% analysis as your code
% when want to get name of current excel file, use work_files(cnt_file), convert from cell to string if need
end
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!