in reply to Re: Rename filenames in perl using regex
in thread Rename filenames in perl using regex

I have something like the following so far to go thru the cleanup as I don't want any _or-.
print "$file\n";

$file =~ tr/_\t\r\n;:/ /;
$file =~ tr/-\t\r\n;:/ /;
$file =~ s/\s+/ /g;
$file =~ s/MY./my/;
$file =~ s/my./my/;
print "$file\n";

Now I am trying to figure out how to match a pattern like if it has '.my' or '.MYc' take '.MY' and place it in 3rd octet, and if it has any # like 1st, .2nd, or .4th then move that infront of the line etc.
  • Comment on Re^2: Rename filenames in perl using regex