How to find duplicate and missing files of a folder

12 vues (au cours des 30 derniers jours)
Rohit P
Rohit P le 26 Mar 2021
Commenté : Rohit P le 27 Mar 2021
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

Réponses (1)

KSSV
KSSV le 26 Mar 2021
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 commentaires
KSSV
KSSV le 26 Mar 2021
Read about unique.
Rohit P
Rohit P le 27 Mar 2021
Okay..i will read it..thank you..

Connectez-vous pour commenter.

Catégories

En savoir plus sur File Operations dans Help Center et File Exchange

Produits


Version

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by