$inputFile = "1.log";
$inTestPath = "testlist";
$outTestPath = "newTestList";
open(INF, "$inputFile") or die("cannot open $inputFile/n");
while(<INF>)
{
if(//.grxml$/)
{
chomp();
s_/g;
s/grxml$/txt/;
$listFile = $inTestPath."//Grammar_".$_;
open(LSF, "$listFile") or print "cannot open $listFile/n";
$outFile = $outTestPath."//Grammar_".$_;
open(OUTF, ">$outFile") or print "cannot open $outFile/n";
}
elsif(/^/--------/)
{
close(LSF);
close(OUTF);
}
else
{
chomp();
s//(//|/;
s//s//|/;
s//)//;
$line = <LSF>;
@items = split(//s/[/, $line);
print OUTF $items[0]." [".$_."]/n";
print $items[0]." [".$_."]/n";
}
}
close(INF);
system("pause");