fullfile to contain multiply file extension

9 次查看(过去 30 天)
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