"; if (!($fp = fopen($file, "r"))) die("Unable to open the input file."); else $lock = flock($fp,LOCK_SH); if ($lock) { while (!feof($fp)) { $buffer = fgets($fp, 30000); $csn = substr($crsid,0,4); $search = trim("COURSE SEQUENCE NUMBER $csn"); $firstBlock = "SECTION SUMMARY - ITEM ANALYSIS"; $questNumb = trim(substr($buffer,4,2)); $omit = trim(substr($buffer,18,2)); $a = trim(substr($buffer,30,2)); $b = trim(substr($buffer,42,2)); $c = trim(substr($buffer,54,2)); $d = trim(substr($buffer,66,2)); $e = trim(substr($buffer,78,2)); $foundN = 0; $searchLB = trim(substr($buffer,38,31)); if(strcmp($searchLB,$firstBlock) == 0) { $frmText = 4; } elseif($frmText == 4){ if(is_numeric($questNumb) != 0){ echo "\"" . $csn . "\"," . $questNumb . "," . $omit . "," . $a . "," . $b . "," . $c . "," . $d . "," . $e . "\n"; $foundN = 1; } elseif($foundN == 1){ if(is_numeric($questNumb) ==0) die(); } else { continue; } } } } $lock = flock($fp,LOCK_UN); fclose($fp); ?>