필터 지우기
필터 지우기

Given i have multiple csv files in a folder, how can i access it and read them?

조회 수: 12 (최근 30일)
Hi
T1=xlsread('file1.csv');
T2=xlsread('file2.csv');
...
How can i access each file in my folder and process them eventually?

채택된 답변

Lukas Bystricky
Lukas Bystricky 2015년 8월 4일
Try something like this
files = dir('*.csv');
num_files = length(files);
results = cell(length(files), 1);
for i = 1:num_files
results{i} = xlsread(files(i).name);
end
  댓글 수: 3
Travis Briles
Travis Briles 2021년 5월 10일
How do you do this if the files are stored in sub-folders within the main directory?

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by