Trying to find duplicate files with DIFFERENT extensions...

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Boznian2
Posts: 14
Joined: 20 Apr 2023 17:10

Trying to find duplicate files with DIFFERENT extensions...

Post by Boznian2 »

I have created duplicates of my ALAC (m4a extension) audio files as FLAC (flac extension). There are thousands of them, and each duplicate file is in the same directory. For example, each artist is its own directory, and has one or more albums as subdirectories, under which there might be 1 or 20 pairs of songs with the exact same name, but the different extensions as above. I need some way to find and delete all the ALAC duplicates.
The duplicate files are NOT the same size; not all the files are duplicated; not all the .m4a's are duplicated. (So I can't just search for *.m4a, or this would be easy).
I have Doppleganger, FolderClone, FolderMatch apps and none of them can do it. Any ideas other than going through them all manually??

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Trying to find duplicate files with DIFFERENT extensions...

Post by highend »

Open the search panel, click on the dupes tab, check [x] Name and in the dropdown, "Ignore Extensions"?
One of my scripts helped you out? Please donate via Paypal

Boznian2
Posts: 14
Joined: 20 Apr 2023 17:10

Re: Trying to find duplicate files with DIFFERENT extensions...

Post by Boznian2 »

I have done that before and the search results in 8,392 items. Scrolling through, most seem to be exactly what I am looking for, a list of [song1.flac] followed by [song1.m4a], etc. HOWEVER, there are many instances where there is just one lone .m4a, (or 2 or 3 in a row). It appears as if it is treating folder names as duplicates also- "Baby Come Back.m4a" is listed as a 'lone' dupe, but "Baby Come Back" is also the folder in which it resides. So obviously, I can't just go through and delete all the *.m4a's in this situation. Is there a way to eliminate folders OR specify files only to be considered dupes? I do have the search criteria set to "Audio files" already.

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Trying to find duplicate files with DIFFERENT extensions...

Post by highend »

Can't replicate that (a file is treated as a "lone" duplicate when a folder with the same name (but ofc without an extension) exists or if such a file is in such a folder)...

But a script can easily do that...
Run it when inside the root folder for all the subfolders (with artist names)...

It will find all .m4a files that have the same name counterpart (as .flac) in the same folder and offers you to delete those .m4a's afterwards...

Code: Select all

    $folders = quicksearch("/d");
    end (!$folders), "No subfolder(s) present, aborted!";

    $delete = "";
    foreach($folder, $folders, <crlf>, "e") {
        $m4as = quicksearch("*.m4a /n", $folder);
        if (!$m4as) { continue; } // No original file(s) present

        $flacs = quicksearch("*.flac /n", $folder);
        if (!$flacs) { continue; } // No possible dupe file(s) present

        foreach($m4a, $m4as, <crlf>, "e") {
            $base = gpc($m4a, "base");
            $dupe = $folder . "\" . $base . ".flac";
            if (strpos($flacs, $dupe) != -1) {
                $delete .= $m4a . <crlf>;
            }
        }
        wait 1;
    }
    if ($delete) {
        $sel = inputselect("File(s) which have a dupe...", $delete, <crlf>, 1+2+4096+16384+32768, , 800, 800);
        if ($sel) {
            delete 1, 1, $sel;
        }
    }
One of my scripts helped you out? Please donate via Paypal

Boznian2
Posts: 14
Joined: 20 Apr 2023 17:10

Re: Trying to find duplicate files with DIFFERENT extensions...

Post by Boznian2 »

Thanks a bunch, you saved me a bunch of time and heartache. Donation made!

highend
Posts: 14571
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Trying to find duplicate files with DIFFERENT extensions...

Post by highend »

No problem and :tup: for the donation :mrgreen:
One of my scripts helped you out? Please donate via Paypal

Post Reply