When I installed Leopard, I installed it to an empty partition using a clean install. I then manually migrate my older documents and settings over time -- it's not that I don't trust the Migration Assistant (well, I don't trust it completely, but that's another story), but that I look on each major OS X upgrade as the chance to clean house. So this weekend, after a slow migration, I decided it was finally time to zero out the old 10.4 partition ... but I had a slight problem.
I archive my iChats, and have done so for many years. In those archives, there's a ton of knowledge that I prefer to keep rather than lose, so I wanted to move the archived chats into my current iChats folder on the 10.5 disk. In 10.4, all iChat archives were stored at the top level of your user's Documents » iChats folder. In 10.5, however, archived chats are now sorted into subfolders based on the date of the chat. I wanted to move my huge archive to the 10.5 partition, but I didn't want to clutter the archives folder with thousands of files at the top level -- I wanted them sorted by date, as in 10.5.
I was pretty sure that Perl could make short work of this problem ... if only I knew Perl. Thankfully, I know someone who knows Perl; you might even say he wrote the book on it. Randal Schwartz (aka merlyn here on macosxhints.com) came to my rescue with a nifty bit of code he cobbled together while waiting for a flight.
With his (mostly, to me) unreadable code, the task of organizing 12,000+ iChat archives took but a couple minutes of run time. The code follows, but please read the warning that follows before trying it yourself.
To use the script, copy and paste the above into a Terminal text editor such as nano or vi. There's one line you need to pay attention to: the my $DIR line. Edit the path shown on that line to reflect the location of your archived iChats. Save the script (ideally somewhere on your user's $PATH), make it executable (chmod a+x scriptname), and then (important!) back up your archived Chats folder -- just in case!Mac OS X Hints
http://hints.macworld.com/article.php?story=2008022420010324