🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.perl.misc
Article #329

"Rename-File-Names" Script Needed, Please

#329
From: Mark Harrison
Date: Wed, 27 Aug 1997 00:00
55 lines
2015 bytes
My Guru Perl Friends:

I'm trying to write a quick script to rename a few thousand files in
sequential order.  Before I tax my novice skills creating a bug-filled
script, I'd like to see if this has been done before and is sitting on
someone's harddrive.

Thanks for any help!

Sie koennen auf Deutsch antworten.
On peut repondre en Francais.
Se puede contestar en Espanol.


I'm trying to rename a few thousand files in sequential order.

ie.

I have:
I want to change it to:

blah.txt   -->       00000001.txt
blub.txt       -->         00000002.txt
this.txt   -->   00000003.txt
that.txt   -->       00000004.txt
etc.txt           -->         00000005.txt


and so on...

At a later date, more files will show up, so I'd like to be able to start
at whatever number I choose.

ie.

>what number do you want to start at?
2409

>ok

blah.txt   -->       00002409.txt
blub.txt       -->         00002410.txt
this.txt   -->   00002411.txt
that.txt   -->       00002412.txt
etc.txt           -->         00002413.txt


I'll probably be running off a Windows box... I've heard there are
differences in the versions of perl.

Cheers, and thanks!

Mark Harrison
<mark@tmn.com>
Technical Details
Message-ID: <mark-2708971659020001@ip187.tmn.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10f591,7a482d725d40d763,start
X-Google-Attributes: gid10f591,public
X-Google-Thread: 112333,7a482d725d40d763,start
X-Google-Attributes: gid112333,public
X-Google-Thread: 1133f4,7a482d725d40d763,start
X-Google-Attributes: gid1133f4,public
X-Google-Thread: fa0ae,7a482d725d40d763,start
X-Google-Attributes: gidfa0ae,public
X-Google-Thread: f72c1,7a482d725d40d763,start
X-Google-Attributes: gidf72c1,public
From: mark@purple.tmn.com (Mark Harrison)
Subject: "Rename-File-Names" Script Needed, Please
Date: 1997/08/27
Message-ID: <mark-2708971659020001@ip187.tmn.com>
X-Deja-AN: 268642529
Organization: UDG
Newsgroups: comp.lang.perl.misc,comp.lang.perl.modules,comp.lang.perl.tk,de.comp.lang.perl,fr.comp.lang.perl