/", $line))
{
$count++;
if ($count%2 == 0)
{
list($temp1, $temp2) = explode(" ", $line);
list($docName, $temp3) = explode(" ", $temp2);
$fileName = $docName . ".html";
$fOut = fopen ($fileName, 'w');
while (!(preg_match("", $line)))
$line = fgets($f2);
$line = fgets($f2);
$title = fgets($f2);
$title = trim($title);
$line = fgets($f2);
while (!(preg_match("", $line)))
$line = fgets($f2);
$text = "";
while (!(preg_match("", $line)))
{
$line = fgets($f2);
$line = trim($line);
if ($line != "")
{
$text = $text . $line;
fwrite($fOut, $line);
}
} // while (!(preg_match("/TEXT>/", $line)))
while (!(preg_match("", $line)))
$line = fgets($f2);
$snippet = fgets($f2);
$snippet = trim($snippet);
fwrite ($f3, "$docName\n$title\n$snippet\n$text\n");
fclose($fOut);
} // if ($count%2 == 0)
} // if (preg_match("//", $line))
} // while(!feof($f2))
fclose($f3);
} // if($f2 = fopen("results.ret", 'r'))
fclose($f2);
?>