private function HandleXLSFile($OldFile, $NewFile, $Fields, $SkipLines, $TrimData) { // Convert the xls file into a CSV file we can easily use $XLStoCSVCommand = Config::GetXLS2CSV() . " -x '{$OldFile}' -b WINDOWS-1252 -c '{$NewFile}' -a US-ASCII >/dev/null"; echo "Executing command {$XLStoCSVCommand}\n"; system($XLStoCSVCommand, $return); if ($return != 0) { trigger_error("Error converting xls file to csv file via {$XLStoCSVCommand}", E_USER_ERROR); } $FileName = $NewFile; $newFile = tempnam(Config::getTmpDir(), "{$this->PartyID}-"); $this->FilesToPurge[$newFile] = NULL; $this->HandleCSVFile($FileName, $newFile, $Fields, $SkipLines, $TrimData); return $newFile; }