mp3
---radiohead
---100395
---01-you.mp3
---132557
---02-creep.mp3
---168860
---01-planet_telex.mp3
(etc.)
---pablo_honey
---the_bends
Each MP3 file was stored in one of those '168860'
directories and nothing was inside the directories that
are actually named after the album titles. On top of that,
i did not know offhand which album that '168860' belongs
to. Normally i rip/encode one CD and then move the MP3's -
now i have to move each file one at a time to it's proper
album/directory and i have to manually look each one up by
scanning the CD with my eyes/brain. Ughh ... that could take
30 minutes! (time better spent watching the Simpsons!)
The quick fix? First, move all MP3 files to inside the 'parent' directory (radiohead).
[jeffa@trinity radiohead]# mv */*.mp3 .Second, run this script:
Much quicker. ;)use MP3::Info; for my $file (<*.mp3>) { my $id3 = get_mp3tag($file); my $dir = lc $id3->{ALBUM}; $dir =~ tr/ /_/; system mv => $file => $dir; }
UPDATE: added Aristotle's improved alternative to backticks. Very nice. :) Oh, and as he says, this only works if your MP3's are properly tagged. Since they came straight from grip ... mine were. ;)
Also, i probably should have used zakzebrowski's suggestion, but it is trivial enough to change that i will leave the code untouched. (see his comment below).
OH YEAH: PodMaster says "CDex for yer win32"jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Move MP3 files to proper dirs
by Aristotle (Chancellor) on Mar 11, 2003 at 03:03 UTC | |
|
Re: Move MP3 files to proper dirs
by Acolyte (Hermit) on Mar 11, 2003 at 18:37 UTC | |
|
Re: Move MP3 files to proper dirs
by zakzebrowski (Curate) on Mar 13, 2003 at 12:23 UTC |