Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?
[jedikaiti]: "finished" 18?
[Discipulus]: yes you know.. happy birthday.. happy birthday..
[jedikaiti]: ahhhh
[jedikaiti]: Never heard it referred to that way
[jedikaiti]: Happy Birthday to him!
[Discipulus]: ah! how do you say in english? .. i was sure..
[Discipulus]: ah turned

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2018-01-18 20:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (214 votes). Check out past polls.

    Notices?