xxxx


#         November
#   Su Mo Tu We Th Fr Sa
#       1  2  3  4  5  6
#    7  8  9 10 11 12 13
#   14 15 16 17 18 19 20
#   21 22 23 24 25 26 27
#   28 29 30
# 

$map{'018'} = '991104';
$map{'022'} = '991105';
$map{'031'} = '991106';
$map{'033'} = '991107';
$map{'045'} = '991108';
$map{'065'} = '991109';
$map{'080'} = '991110';
$map{'087'} = '991111';
$map{'099'} = '991112';
$map{'110'} = '991113';
$map{'000'} = '991114';
$map{'118'} = '991115';
$map{'124'} = '991116';

$base = '990000';
while (<>) {
	s/[\r\n]+$//;
	$file = $_;
	if ($file =~ /^(.*)\.(.*)$/) {
		$s = $1;
	} else {
		##print "$file???\n";
		next;
	}
        next if (!($s =~ /^\d+$/));
        $base = $map{$s} if ($map{$s} ne '');
	++$counts{$base};
	printf("mv $s.jpg $base%02d.jpg\n", $counts{$base});
}

Back