Closed chrisooo3 closed 2 years ago
My csv file looks like this:
"Col1";"Col2";"Col3";Col4;Col5; 2869;"=""510015171""";"=""7393077918""";Test;"Name";
After executing this code:
$reader = Reader::createFromPath('/file.csv'); $reader->setDelimiter(';'); $records = $reader->getRecords(); foreach ($records as $record) { dump($record['Col1']); }
I am getting the following error:
WARNING [php] Notice: Undefined index: Col1
The format of CSV file is correct because it opens in libre office correctly.
@chrisooo3 thanks for using the library. The package does not autodetect headers you need to specify the header row as explain in the documentation.
My csv file looks like this:
After executing this code:
I am getting the following error:
The format of CSV file is correct because it opens in libre office correctly.