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

Re: I have a folder which is having 1200 files,all the file names are have maximum of 8 character length.I need to remove last character from each of the filnames and prefix it with character "A"

by moritz (Cardinal)
on Feb 20, 2013 at 20:13 UTC ( #1019840=note: print w/ replies, xml ) Need Help??


in reply to I have a folder which is having 1200 files,all the file names are have maximum of 8 character length.I need to remove last character from each of the filnames and prefix it with character "A"

rename 's/^.(\w+)\.(\w+)$/$1A.$2/' maybe. Run it with the -n option first to review it.

The rename or prename tool is shipped with perl, and occasionally very helpful.


Comment on Re: I have a folder which is having 1200 files,all the file names are have maximum of 8 character length.I need to remove last character from each of the filnames and prefix it with character "A"
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019840]
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-07-13 06:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (247 votes), past polls