问题描述:用扫描仪扫描的文件都创立一个文件夹,现在要把文件都提取出来。嘿嘿,我是菜鸟,请多指教。
测试环境:sygwin
#!/usr/bin/perl -w
$files_name = "/home/xuan/testdir/QUST";
chdir $files_name;
my @files = glob "*";
foreach my $single_file (@files){
next unless $single_file =~ /^2014/;
my $file_name = $files_name . "/" . $single_file;
chdir $file_name;
my @file = glob "*";
foreach (@file){
$photo_path = $files_name ."/" . $_;
rename $_,$photo_path;
}
chdir $files_name;
rmdir $single_file;
print "$file_name\n";
}