How do I count the number of .CSV files in a folder?
238 次查看(过去 30 天)
显示 更早的评论
Hi,
I would like to know how to count the number of .CSV files in my folder? I have to do this for multiple folders so I would like to choose them.
So far I have something like this...
source_dir = uigetdir([]);
d = dir([source_dir, '\*.csv']);
n=length(d(not([d.isdir])));
but I get an error at the second line. Help!
0 个评论
回答(1 个)
Image Analyst
2013-11-18
n=length(d)
6 个评论
Miranda Zhang
2017-6-3
Do you use Mac OS? I had the same problem but then realised it's because I'm supposed to use '/' instead of '\' because it's not Windows.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!