#!/usr/bin/perl print "Enter the <dir> where the mp3's are found: "; chomp ($dir = <stdin>); chdir($dir) or die "Canot change $dir :$!\n"; opendir(DIR, $dir) or die "Cannot open $dir:$!\n"; @songs = readdir(DIR); closedir(DIR); @songs=grep(/(.mp3)|(.MP3)|(.mP3)|(.Mp3)/,@songs); foreach(@songs) { if($_ =~ m/^(.*)\s*-\s*(.*).mp3/i) { my $end = $2; my $start = $1; $start =~ s/\s*$//; s/{|}//g for ($start, $end); rename $_,"$start - $end.mp3"; print "$start - $end.mp3\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Mp3 Renamer
by myocom (Deacon) on Jan 07, 2001 at 10:43 UTC | |
by jeffa (Bishop) on Jan 07, 2001 at 12:30 UTC | |
by Anonymous Monk on Jan 07, 2001 at 22:50 UTC | |
by chipmunk (Parson) on Jan 07, 2001 at 23:11 UTC | |
|
Re: Mp3 Renamer
by AltBlue (Chaplain) on Jan 16, 2001 at 23:10 UTC | |
|
(redmist) Re: Mp3 Renamer
by redmist (Deacon) on Jan 07, 2001 at 16:13 UTC | |
by tilly (Archbishop) on Jan 07, 2001 at 23:49 UTC | |
by redmist (Deacon) on Jan 08, 2001 at 03:16 UTC |