in reply to Rename filenames in perl using regex

> Any suggestion will be greatly appreciated.....

see

For a platform independent "move" function look at the File::Copy module.

edit

and ...

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)

¹) or glob

²) or split

  • Comment on Re: Rename filenames in perl using regex

Replies are listed 'Best First'.
Re^2: Rename filenames in perl using regex
by ArifS (Beadle) on Aug 29, 2014 at 16:33 UTC
    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.