#!/usr/bin/perl -w #Rename's files to remove spaces and other shitz @names = qx {ls}; $a = qx {pwd}; @band = split(/\//, $a); $band[2] =~ s/\_//; chomp $band[2]; print "$band[2]\n"; foreach $file (@names) { chomp $file; $new = $file; $new =~ s/\.mp3//; $new =~ s/\W//g; $new =~ s/\_//g; $new =~ s/$band[2]//gi; if ( $file !~ "$band[2]\_$new\.mp3") { print "\tRenaming $file to $band[2]\_$new.mp3\n"; qx {mv \"$file\" "$band[2]\_$new\.mp3"}; } else { print "\tNo Change for $file\n"; } }
20071014 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
In reply to RE: Mp3Mat
by Anonymous Monk
in thread Mp3Mat
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |