Re: File renaming command or script?

Kezdőlap
Csatolmányok:
Üzenet email-ben
+ (text/plain)
Üzenet törlése
Válasz az üzenetre
Szerző: Jerry Davis
Dátum:  
Címzett: plug-discuss
Új témák: Solved! Re: File renaming command or script?
Tárgy: Re: File renaming command or script?
On Tuesday 16 November 2004 09:26 pm, Alan Dayley wrote:

this is crude but it works:

#!/usr/bin/env perl

my @fromfiles = <*.JPG>;
my @tofiles = <*.JPG>;

my $n = 1;
my $n3;

foreach (@tofiles) {
/.*_(.*)\.JPG/;
$n3 = sprintf "%3.3d", ($n);
s/$+/$n3/;
$n++;
}

for(my $n=0; $n<$#fromfiles; $n++) {
system "mv $fromfiles[$n] $tofiles[$n]\n";
}

--
Registered Linux User: 275424
Today's Fortune: Life's the same, except for the shoes.
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss