Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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?

What's my password?
Create A New User
Node Status?
node history
Node Type: CUFP [id://311703]
Approved by Paladin
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: (6)
As of 2016-06-26 11:24 GMT
Find Nodes?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...

    Results (328 votes). Check out past polls.