Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Script to rename mp3s based on id3 tags

by Boots111 (Hermit)
on Jul 21, 2003 at 21:28 UTC ( [id://276480]=CUFP: print w/replies, xml ) Need Help??

All~

Of late I decided to run through my mp3 collection and standardize the filenames. I figured that this would be a perfect candidate for a small script. I ran into a little trouble with Mp3::Tag not supporting some of the tag versions that I have. But after exploring CPAN for a little while, I got everything working using MP3::Info. Apologies to everyone for the very Windows specific `move ...`
use MP3::Info; opendir(DIR, ".") or die "can't opendir $some_dir: $!"; @files = grep { /mp3/ } readdir(DIR); closedir DIR; for (@files) { my $tag = get_mp3tag($_) or print "Could not access tag on $_\n" and next; my $newname = $tag->{"ARTIST"} . " - " . $tag->{"TITLE"} . ".mp3"; `move "$_" "$newname"`; }
Comments are most welcome,
Boots
---
Computer science is merely the post-Turing decline of formal systems theory.
--???

Replies are listed 'Best First'.
(jeffa) Re: Script to rename mp3s based on id3 tags
by jeffa (Bishop) on Jul 21, 2003 at 22:10 UTC
Re: Script to rename mp3s based on id3 tags
by barbie (Deacon) on Jul 21, 2003 at 23:54 UTC
    Also have a look at The Mad Hatter's latest script contribution "Intelligent" ID3v2 Tagger. It works in the opposite direction to your script, but it might give you a few ideas.

    --
    Barbie | Birmingham Perl Mongers | http://birmingham.pm.org/

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://276480]
Approved by phydeauxarff
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found