Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-10-01 10:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (6 votes), past polls