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.
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!