更多內容,請訪問個人 我的博客。spa
use FindBin qw($Bin);
#遍歷文件夾
my $fileReportDir = $Bin; #出報告所在的文件夾地址
if(-e $fileReportDir){
opendir DIR, $fileReportDir || die "Error in opening dir $fileReportDir\n";
while( my $file = readdir(DIR)){
next if $file eq ".";
next if $file eq "..";
my $fileAll = $fileReportDir."/".$file;
if(!unlink($fileAll)){
print "=====程序終止!=====\n刪除表格(".$fileAll.")失敗,請手動刪除\n";
#保留黑框
system pause;
#程序中止運行
die;
}
}
closedir DIR;
}
#讀取文件內容
open FILE, "<$file" || die "Not Found file: $file\n";
while (<FILE>){
my ($gene,$chr) = (split /\t/,$_)[0,1];
}
close FILE;
複製代碼