Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Renaming Files with Regular Expressions

by svsingh (Priest)
on Dec 02, 2003 at 18:25 UTC ( #311703=CUFP: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    &renameFiles( &getArgs() );
    ...
          rename( $before, $after );
       }
    }
    
  2. or download this
    perl renrx "s|(.*?)(\d\d) ([^_]+) _ (.*?)(\.mp3)|$1$2 $4 _ $3$5|"
    
  3. or download this
    Maybe-01 Winter Wonderland _ Phantom Planet.mp3 => Maybe-01 Phantom Pl
    +anet _ Winter Wonderland.mp3
    Rename? [Yes|No|Always|Cancel] y
    Maybe-02 Maybe this Christmas _ Ron Sexsmith.mp3 => Maybe-02 Ron Sexsm
    +ith _ Maybe this Christmas.mp3
    Rename? [Yes|No|Always|Cancel] a
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://311703]
Approved by Paladin
help
Chatterbox?
[james28909]: who isnt confused?
[james28909]: lol
[james28909]: my wife isnt confused... she knows everything

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2017-12-15 13:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (432 votes). Check out past polls.

    Notices?