Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

(zdog) Re: (2) how to rename all files in a dir

by zdog (Priest)
on Jul 07, 2002 at 15:49 UTC ( #179983=note: print w/replies, xml ) Need Help??


in reply to (jeffa) Re: how to rename all files in a dir
in thread how to rename all files in a dir

In case there is no specified file extension like .txt, something like this can be done:

perl -e 'for (grep {-f} <*>) { rename $_, sprintf("%02d%s", ++$i, $_) }'

Zenon Zabinski | zdog | zdog@perlmonk.org

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://179983]
help
Chatterbox?
[MidLifeXis]: I almost think that the coach is benching me. WTH?
[1nickt]: MKE?
[MidLifeXis]: MKE
[marto]: Milwaukee

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2017-03-23 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (286 votes). Check out past polls.