# 將選好的JPEG檔複製到NEF目錄,好的JPEG檔複製到NEF目錄,執行後將JPEG
# 檔移到JPEG目錄,沒有配對的NEF移到_del目錄,配對的NEF留在原目錄。
use strict;
use File::Copy;
use File::Basename;
use Time::HiRes qw(gettimeofday);
use 5.010;
my $t0 = gettimeofday;
my $DestRAW = "NEF/";
my $DestJPEG = "JPEG/";
my $DelFolder = "_del/";
chdir $DestJPEG;
my @fileJPG = glob "*.JPG";
chdir "..";
chdir $DestRAW;
my @fileRAW = glob "*.NEF";
chdir "..";
###############################################################################
mkdir $DelFolder;
#先排序
@fileJPG = sort @fileJPG;
@fileRAW = sort @fileRAW;
for( my $i = 0; $i #print $fileJPG[$i].' ';
my $JPG = uc($fileJPG[$i]);
$JPG =~ s/\.JPG/\.NEF/;
for( my $j = 0; $j if ( $JPG eq uc($fileRAW[$j]) ) {
#say "$JPG = $fileRAW[$j]";
$fileJPG[$i] = undef;
$fileRAW[$j] = undef;
last;
}
}
}
&moveFile($DestJPEG, $DelFolder, @fileJPG);
&moveFile($DestRAW, $DelFolder, @fileRAW);
my $t1 = gettimeofday;
printf("Time: %3.3f sec\r\n", $t1 - $t0);
system("pause");
sub moveFile() {
for (2..$#_) {
if ($_[$_] ne undef) {
my $src = $_[0].$_[$_];
my $dest = $_[1].$_[$_];
say 'move '.$src." to ".$dest;
move($src, $dest) if (-e $src);
}
}
}
- Sep 13 Thu 2012 00:09
RAW+JPEG_paired_Folder 第一版
close
全站熱搜
留言列表