发表于: 2007.02.24 20:16
分类: 技术文章
出处: http://atgc.itpub.net/post/22412/264662
---------------------------------------------------------------
open(F1,">test.dat");
open(F,"test.txt");
while(<F>)
{
/^(S{1})/i;
$hash_segment{$1}++;
print F1;
}
close(F);
close(F1);
open(F,"test.dat");
while(<F>)
{
/^(S{1})/i;
if ($hash_segment{$1}<=2)
{
if (!exists($hash_new{$1}))
{
$filename='valid'.$1.'.dat';
open (FO,">$filename");
}
$hash_new{$1}='';
print FO;
}
else
{
$hash_rest{$1}='';
}
}
close(F);
undef %hash_new;
undef %hash_segment;
sdfds











