12 Replies Latest reply: Jun 6, 2010 11:26 PM by stevep314
minofsteel Level 1 Level 1 (0 points)
It annoys me that when I rip CDs in iTunes, it automatically puts the track # as part of the file name of a song. For example - Angry Young Man becomes 01 Angry Young Man. Is there ANYTHING I can do to stop iTunes from doing that?

Windows 7
  • Katrina S. Level 7 Level 7 (24,090 points)
    Here is a post from turingtest2 that fixed it for itunes 8. I don't know if it still works for itunes 9.
    The directions are for XP. The paths will be a little different for Vista.

    http://discussions.apple.com/message.jspa?messageID=9337997#9337997
  • minofsteel Level 1 Level 1 (0 points)
    Thanks - tried it - didn't work. I have windows 7.
  • Katrina S. Level 7 Level 7 (24,090 points)
    That's too bad. I guess you're stuck with the track and disk numbers, when using itunes, then.
    You could rip using WMP and add them to itunes.
  • turingtest2 Level 9 Level 9 (55,455 points)
    I've just revisited that post and, apart from a minor misdirection over the location of the relevant file, it still holds true for iTunes 9.1.1.11. For XP the preferences file is at *C:\Documents and Settings\<User>\Application Data\Apple Computer\iTunes\iTunesPrefs.xml*. According this support doc. the locations for Windows 7/Vista should be *C:\Users\<User>\AppData\Local\Apple Computer\iTunes\iTunesPrefs.xml* or *C:\Users\<User>\AppData\Roaming\Apple Computer\iTunes\iTunesPrefs.xml*. If you still can't find it then search for iTunesPrefs.xml and include hidden and system files and folders in the search.

    Putting it all togther this should do the trick...
    *To remove the leading track numbers in Windows Vista/7:*
    1) Shutdown iTunes
    2) Backup your prefs file - *C:\Users\<User>\AppData\<Local | Roaming>\Apple Computer\iTunes\iTunesPrefs.xml*
    3) Edit the file in a real text editor that understands UNIX linefeeds (notepad++, ultraedit, vi, etc) and paste the following lines below the <dict> line under *<key>User Preferences</key>:*

    <key>create-filenames-with-disknumber</key>
    <data>
    AA==
    </data>
    <key>create-filenames-with-tracknumber</key>
    <data>
    AA==
    </data>

    4) Start iTunes. Open the Preferences dialog. On the advanced tab uncheck *Keep iTunes Music folder organised*. Click OK, reopen the Preferences dialog & recheck *Keep iTunes Music folder organised*, click OK. iTunes should now go through your library removing any leading numbers.

    Of course you're still left with iTunes other naming foibles, i.e. short file & folder names, all invalid characters replaced with underscores etc. If you want more control then I'm working on a script that lets you select a bunch of files and then have them renamed according to your preferences. It's still kind of a work in progress, as I've yet to deal properly with supplementary files such as folder art, but if you're interested I'll post up what I have so far...

    tt2
  • stevep314 Level 1 Level 1 (0 points)
    Hi,

    I just read your post regarding removing track numbers from file names (as added by Itunes when it manages your files) and would be very interested in a script which would give me much more control (i.e. iTunes & other naming foibles, i.e. short file & folder names, all invalid characters replaced with underscores etc.).

    I just tried the fix which you suggest above but it didn't work for me. (running on Windows XP / Itunes 9.1.1 /
    Itunes Prefs: Keep iTunes Music Folder organized was not checked).

    Each time I imported a cd, track numbers appeared in the filename.

    So, I applied your fix but certain songs received track numbers and others did not.

    Anyway, I'm really getting frustrated and annoyed by Itunes, so a script which would tackle all these problems would be really interesting.

    Therefore if you have any further news regarding the script you're working on, or would have more info regarding the prob's i'm experiencing with your fix, please do let me know.

    Best regards,

    Steve Pittoors
  • ed2345 Level 7 Level 7 (21,020 points)
    stevep314 wrote:

    Anyway, I'm really getting frustrated and annoyed by Itunes, so a script which would tackle all these problems would be really interesting.


    Steve, If you have specific requirements for ripping, you should consider another ripping program. Most ripping programs, e.g. WMP, CDex, etc, have much more control over file naming than does iTunes.

    You can rip your CDs in any program, and add the resulting MP3s to your iTunes library.
  • stevep314 Level 1 Level 1 (0 points)
    Ah, yes. Good thinking!

    Only i rip my cd's in full quality 44khz 16bit .wav's so that would mean to manually input all the info myself. Since there is no meta data in .wav's.

    So i'm afraid that's not really an option for me. It's still easier just to delete the track numbers from the files and manually relink the files.

    Thanks anyway,

    Steve
  • turingtest2 Level 9 Level 9 (55,455 points)
    If *Keep iTunes Media Folder organised* is not checked then the hack should only apply to tracks newly ripped with iTunes. If it is checked then it should be applied to all tracks inside the iTunes Media folder, but tracks outside the iTunes Media Folder that have been imported into your library will remain unaffected.

    I'm afraid I still don't think my own script is ready for release as I haven't yet integrated moving associated artwork, cleaning-up emptied folders or an easy way to define options for path & file naming rules so at the moment it's hard-coded to my preferences.

    What I have found very useful in the past is MediaMonkey (don't let it steal the file associations during the install), though of course using that you have to let it rename things, then remove the tracks from iTunes & reimport.

    Again that won't work for your .wavs, however a simple script to strip the leading disc & track numbers from the filenames shouldn't be too hard. I should be able to get something done for that later tonight or tommorrow.

    +Watch this space.+

    tt2
  • turingtest2 Level 9 Level 9 (55,455 points)
    OK here we go...

    StripTrackNumbers will strip out leading disc & track numbers from the filenames of selected tracks.
    AddTrackNumbers will reinsert leading track numbers into the filenames of selected tracks.
    AddDisc-TrackNumbers will reinsert leading disc & track numbers into the filenames of selected tracks.

    In a similar fashion to the normal iTunes behaviour, disc numbers are only added if the track has a non-zero track number, non-zero disc number and the disc count is greater than one. These scripts only modify the leading track or disc numbers of the filenames. The rest of the filename and the parent folder names are not changed. The scripts will produce unexpected results if the track title also includes leading digits, an issue I might address in future versions.

    Backup everything before you try them out. Download the script(s) to your desktop, select a bunch of files in iTunes and double-click on the script to execute. If you fail to select any tracks in advance it will attempt to work with the current playlist.

    Hopefully you'll find the above useful, although given that you are using .wav as a file format I would actually caution against removing track numbers. If your iTunes database were lost there would be no way to rebuild the track information from the path details. In contrast if your files are properly organised in a form such as:

    <Main Path>\<Album Artist>\<Album>\\[D<-|.>\][##\[< |-|.>\]\]<Name>\[ - <Artist>\].<Ext>


    then my script TagFromFilename can reconstuct most of the essential information whereas iTunes will just set the track name to the filename.

    tt2
  • Katrina S. Level 7 Level 7 (24,090 points)
    Steve, just a side note if you're using WAV files: make sure to always keep good backups of the itunes database file
    iTunes Library.itl




    If it ever goes missing or gets corrupted, you'd be looking at hours of work to restore everything to itunes. There are a few posts around here where folks lost that ITL file, and when they added everything back to itunes, it dumped it all in an Unknown artist/Unknown album folder. Yikes!
  • stevep314 Level 1 Level 1 (0 points)
    Hi,

    Thanks for the quick follow and the effort made.

    I'll surely check your scripts as these would indeed make correcting the filenames much easier.

    I'm currently running my itunes Library without having Itunes manage my files, and thus avoiding the addition of track names to already exisiting wav. files, but when adding new files, track numbers are still being added to the filenames...

    I also use a program called "Checksum" to check if certain files are changing over time, and this can now not be properly used anymore as any changes made in Itunes (changing a title etc. for example) are not automatically made to the wav. file name.

    I implemented your fix above (editing the iTunes pref. file) in an older version of Itunes and it worked fine, track numbers did not appear when new files were added (still having Itunes manage the music files), but this is not working anymore with version 9.1.1. ?

    Is there a way I could implement your fix above with Itunes 9.1.1. so no tracknumbers are added to the filenames but still having Itunes manage the library (so changes made to titles etc. are also automatically made to wav. files.

    Thanks again!

    Best regards,

    Steve
  • stevep314 Level 1 Level 1 (0 points)
    Katrina,

    Thanks for your tip! Ofcourse I keep a backup of both .itl and .xml file as well as my library .wav files. So i can always go back to a correct state. Only problem is when you click that "Keep iTunes Media Folder organised" then if somemthing is not right and iTunes starts to rename some files, I have to re-copy my complete library. (600+gb) But that's not the end of the world.

    Thanks again!

    Steve