Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: renaming files

by graff (Chancellor)
on Dec 16, 2011 at 03:49 UTC ( #943872=note: print w/ replies, xml ) Need Help??


in reply to renaming files

ls *.mp3 | perl -lne '($n=$_)=~s/(..).*/$1_my_guitar.mp3/; rename $_, +$n'
or
perl -e 'for (<*.mp3>){($n=$_)=~s/(..).*/$1_my_guitar.mp3/; rename $_, + $n}'
(both are untested)


Comment on Re: renaming files
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://943872]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2014-09-20 14:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (159 votes), past polls