Find duplicate subfolders

D

David C

I need to loop through an entire directory of folders and look for any that
have the same 1st 4 characters. I know how to loop and read just the 1st 4
characters but I need some help determining how to find a duplicate. For
example:

Folder1
Subfolder 0001.....
Subfolder 0002....
Subfolder 0001... (this is a duplicate)

Folder 2
Subfolder 0001...
etc.

David
 
G

George Ter-Saakov

You can use Hashtable for that.

Read them and add to Hashtable with a key being a folder's name (first 4
char). You can check if such key already exists by using
if( map["foldername4char"] != null )
map["foldername4char"] = folder;
else
delete duplicate folder.


George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top