How do I rename folders based on ID3 tags?
August 20, 2005 12:38 PM   Subscribe

How can I rename my music folders on my Mac based on ID3 tags?

Doug's Applescripts and iTunes have done wonders in helping me organize my music, but I'm looking for even more nit-pitcky precision. I already use Plaid Cow Solutions' Rename Files to get my filenames to reflect my ID3 tags, but I wanted to know if there were a way to do something similar with the folders.

For example, I would like the contents of my Built to Spill folder to look like this:

[1994] There's Nothing Wrong With Love
[1997] Perfect From Now On
[1999] Keep it Like a Secret
[2000] Live
[2001] Ancient Melodies of the Future

... and so on. Is there any solution short of renaming every single folder by hand?
posted by themadjuggler to Technology (12 answers total)
 
I use Chaotic Software's MP3Rage to do this, and love it. It helps with a lot of other mp3 file management tasks as well. Well worth checking out.
posted by NewGear at 1:35 PM on August 20, 2005


I second MP3 Rage. It isn't free, but it's very powerful. If you have any significant amount of mp3 file moving/renaming/organizing to do it will save you loads of time and effort.
posted by bcwinters at 2:01 PM on August 20, 2005


Why are you dealing with folders directly? If you're using iTunes, after all, that's your organized music collection there, you almost never need to dig into the actual filesystem.
posted by wackybrit at 3:37 PM on August 20, 2005


wackybrit
Good question, and I'm usually a big proponent of iTunes' organization, but I am often in the file structure over a network in order to pick songs for my radio show, my organization for compilations and soundtracks is slightly different, and I'm just a total neat freak.

Thanks for the MP3 Rage suggestion, I'll check it out!
posted by themadjuggler at 3:41 PM on August 20, 2005


You could bang out a pretty quick Perl script to do it. I can provide more specific advice if you decide to go this route.
posted by patgas at 3:42 PM on August 20, 2005


I realize this is a Mac-centric thread, but can anyone make the same suggestion for Windows?
posted by nightengine at 5:51 PM on August 20, 2005


For Windows:

You could bang out a pretty quick Perl script to do it. I can provide more specific advice if you decide to go this route.

hee.
posted by patgas at 6:52 PM on August 20, 2005


ID3 and mp3 management has been my nagging motivation to learn Perl and/or Applescript, patgas. Can you recommend something to check out as a starting point?

I, too, am unhappy with the iTunes file structuring.
posted by rfordh at 10:52 PM on August 20, 2005


I use ID3X from 321apps, the program has a feature where you can batch rename MP3's according to their tags, and set folder structure. I personally use first level "Artist", second level "Album" in my albums folder. Seems to work a treat, its quick and problem free.
posted by samstarling at 3:00 AM on August 21, 2005


Tag&Rename (Windows)
posted by Merdryn at 11:00 AM on August 22, 2005


There are a couple of command-line id3 tools in the Fink repository that you could use. As I've just bought an iBook, I'm doing this very thing. I should be able to get a small Bash script here before this article closes ...
posted by scruss at 11:24 AM on August 31, 2005


#!/bin/bash
# itunes_sanity.sh - fix dir names created by iTunes
# only works for mp3s, and not actually tested on a Mac
# created by scruss on Sun Sep 4 22:05:00 EDT 2005

find "$@" -type d -mindepth 1 | while read directory
do
  artistdir=$(dirname "$directory")
  firstfile=$( find "$directory" -type f -iname '*.mp3' | head -n1 )
  year=$( id3info "$firstfile" | egrep ' TYE ' | sed 's/=== TYE (Year): //; s/[^0-9]*//;' )
  album=$( id3info "$firstfile" | egrep ' TAL ' | sed 's,=== TAL (Album/Movie/Show title): ,,;' )
  echo mv \'$directory\' \'$artistdir/\[$year\] $album\'
done
So if you were in the terminal, in your music library (one up from the individual artist directories), and you did:
itunes_sanity.sh Dan\ Jones Tripping\ Daisy
you'd get:
mv 'Dan Jones/Get Sounds Now' 'Dan Jones/[2005] Get Sounds Now'
mv 'Dan Jones/One Man Submarine' 'Dan Jones/[2003] One Man Submarine'
mv 'Tripping Daisy/Jesus Hits Like the Atom Bomb' 'Tripping Daisy/[1998] Jesus Hits Like the Atom Bomb'
If that looks okay, run the output through the shell:
itunes_sanity.sh Dan\ Jones Tripping\ Daisy | sh
and all should be well.

You'll need id3lib, which is probably most easily installed from Fink. Also, this only works for mp3 files; I can't grok the tag info for AAC files. And finally, this might go seriously screwy on weird characters in filenames.
posted by scruss at 8:12 PM on September 4, 2005


« Older Why is it that when I drink lo...   |  What should I do with old pigg... Newer »
This thread is closed to new comments.