setReadDataOnly(true); $objSS = $Reader->load($cmd['f']); // Get the first and only worksheet $wksht = $objSS->getSheet(0); $col1 = true; // Bool to determine which column we're in within the loop $ccis = array(); // Array to hold cci-control mappings // Main loop to read in the Excel spreadsheet foreach ($wksht->getRowIterator() as $row) { foreach ($row->getCellIterator() as $cell) { if ($col1) { // First column is the control $ctrl = $cell->getValue(); } else { // Second column is the cci $cci = $cell->getValue(); } // Change the col1 to iterate between the two columns $col1 = !$col1; } $cci_id = substr($cci, strpos($cci, "-") + 1); array_push($ccis, array($cci_id, $ctrl)); } $db->save_EMASS_CCIs($ccis); unset($objSS); if (!isset($cmd['debug'])) { rename($cmd['f'], TMP . "/rmf/$base_name"); } function usage() { print <<