Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have all my songs in my external hard drive, which is encoded in ntfs. When I add them to itunes, using File -> Add To Library ... it create an alias of each file in my /Users/<user_name>/Music/iTunes/iTunes Media/Music folder.

So far so good, but sometimes it gets confused and create 2 aliases for one same file (meaning the same file on my external drive). It also happens when I want to rescan a folder I have already added to iTunes, it will create a duplicate alias for all the files that were already there in iTunes.

So I end up with loads of duplicate aliases in my iTunes Music folder. It looks a bit like that:

<whatever the song name>.mp3
<whatever the song name> 1.mp3

So the second file is a duplicate. What I want to do is:

  1. Delete the aliases from the finder
  2. Delete the duplicates in itunes

As I have a lot of music, it would take a long time to delete everything manually. As I happen to be a software developer, I have written a script that deletes the duplicate alias files (in finder).

But then I end up with an iTunes library full of duplicates, that points to nothing since the alias as been deleted.

Is there a way to delete from the iTunes library all the files that can not be found ?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Try Dupin or Dupin Lite. Dupin is $15 from the developer's site, and Dupin Lite is $8 from the Mac App Store. I recently purchased the full version and used it to delete duplicates from a 57,000 song library. It did a very good job. It's filtering mechanism is highly customizable. It is not super fast, but it ran through my library in less than a day.

To specifically deal with your issue, you can set the rules to keep the file with the shorter filename. This will get rid of the commonly found "whatever the song name 1.mp3" file, while keeping the "whatever the song name.mp3" version.

Also, dougscripts.com should be your first stop for any iTunes maintenance scripts. I have found the following scripts especially useful in cleaning up large iTunes Libraries:
Artist - Name Corrector
Super Remove Dead Tracks
Search-Replace Tag Text v2.0
Track Parser
Remove n Characters From Front or Back

share|improve this answer
    
I'll probably use the "Super Remove Dead Tracks", since I already did a part of the work by deleting the aliases. Thanks –  jules Jun 14 '11 at 8:19

I'm in the middle of this painful task myself. If you have a Windows OS, you may find the following tools in Command Prompt useful after you open command prompt and change directories to your music directory:

dir /s /b "* 1.mp3" > found.txt

which searches all subdirectories (/s) and in a very basic format (/b) lists every single file that ends with " 1.mp3" and exports it (>) to a new text file called found.txt. It's very important that before you delete anything vital that you comb through this list to temporarily transport false positives such as "02 My favorite long chapter - part 1.mp3" to a separate directory BEFORE you start attacking every file that ends with " 1.mp3".

erase /s "* 1.mp3"

after completing the previous step, cross your fingers and hope that you have safely transported all false positives to a safe directory, then press enter and watch the command prompt permanently delete every offending file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.