fullfile to contain multiply file extension

조회 수: 9 (최근 30일)
as hz
as hz 2013년 5월 7일
Hi,
How can I make that a fullfile contain multiply file extension (CSV, XLS, ODS) so my baseFiles have all the files with these extensions?
This code does not work:
fPattern = fullfile(handles.sourceFolder, '*.csv', '*.xls', '*.ods');
baseFiles = dir(fPattern)
Thanks.

채택된 답변

Lluis Roca
Lluis Roca 2013년 5월 7일
편집: Lluis Roca 2013년 5월 7일
Try:
filePatternCSV = fullfile(handles.sourceFolder, '*.csv');
csvFiles = dir(filePatternCSV);
filePatternXLS = fullfile(handles.sourceFolder, '*.xls');
xlsFiles = dir(filePatternXLS);
filePatternODS = fullfile(handles.sourceFolder, '*.ods');
odsFiles = dir(filePatternODS);
allFiles= vertcat(csvFiles,xlsFiles,odsFiles);

추가 답변 (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