Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

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 chanting in the Monastery: (16)
As of 2015-11-24 22:16 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (664 votes), past polls