-
-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetchAssoc() fails with freshly created Reader #213
Comments
For whatever reason, the following code works: foreach ($reader->fetch() as $row) {
$write->insertOne(array_intersect_key($row, $columns_to_extract));
}
$reader = Reader::createFromString((string) $write); |
@shadowhand it works because the latter uses |
My "fix" appears to break other things. :) I'll trust you can sort it out. |
@shadowhand while waiting for the patch in your code if you change
It will work. |
@shadowhand the PR #215 should fix your code could you try it please if it's ok for you I'll release the patch |
version 8.2.1 is out with the fix |
Just confirmed that this fix works. Thanks! |
Issue summary
I need to pre-process a CSV file that was given to me that contains a number of columns with duplicate names. In order to process this file I am creating a reader, writing some columns with a writer, and then getting a reader:
And then I pass the
$reader
into another class that usesfetchAssoc()
:This works fine for other CSVs, but as soon as I add this pre-processing step, I get the following error:
System informations
(In case of a bug report Please complete the table below)
Standalone code, or other way to reproduce the problem
See description.
Expected result
No error.
Actual result
Exception thrown.
The text was updated successfully, but these errors were encountered: