How do I count the number of .CSV files in a folder?
조회 수: 85 (최근 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에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!