Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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 scrutinizing the Monastery: (6)
As of 2014-08-23 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls