diff --git a/app/Jobs/ProcessStmtNarrFormatDataJob.php b/app/Jobs/ProcessStmtNarrFormatDataJob.php index b8885a3..00a0816 100644 --- a/app/Jobs/ProcessStmtNarrFormatDataJob.php +++ b/app/Jobs/ProcessStmtNarrFormatDataJob.php @@ -29,7 +29,7 @@ public function handle() : void { - $filePath = storage_path('app/20240901.ST.STMT.NARR.FORMAT.csv'); // Adjust this path as needed + $filePath = storage_path('app/20250207.ST.STMT.NARR.FORMAT.csv'); // Adjust this path as needed try { if (!file_exists($filePath)) { throw new Exception("File not found: $filePath"); @@ -45,11 +45,13 @@ if ($handle !== false) { $headers = (new TempStmtNarrFormat())->getFillable(); - while (($row = fgetcsv($handle, 0, ";")) !== false) { + while (($row = fgetcsv($handle, 0, "~")) !== false) { if (count($headers) === count($row)) { $data = array_combine($headers, $row); try { - TempStmtNarrFormat::updateOrCreate(['_id' => $data['_id']], $data); + if($data['_id'] !== 'id') { + TempStmtNarrFormat::updateOrCreate(['_id' => $data['_id']], $data); + } } catch (Exception $e) { Log::error('Error processing stmt narr format: ' . $e->getMessage()); }