How to find duplicate and missing files of a folder
10 ビュー (過去 30 日間)
古いコメントを表示
Hello all, I have a folder in which there are 6 subfolders and each of those 6 subfolders have 100 .txt files.i want to find out how many files are duplicate files of same name and display them.and also i want to find out how many files are missing.please help
0 件のコメント
回答 (1 件)
KSSV
2021 年 3 月 26 日
folders = dir('*') ;
N = length(folders) ;
filenames = cell([],1) ;
n = 0 ;
for i = 2:N
if isfolder(folders(i).name)
n = n+1 ;
filenames(n) = dir([folders(i).name,filesep,'*.txt']) ;
end
end
Now you have all the filenames, you can get what you want using that.
c = ismember({filename(1).name},{filenames(2).name})
3 件のコメント
参考
カテゴリ
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!