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

setDelimiter has no effect on output #244

Closed
alperyazgan opened this Issue Aug 21, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@alperyazgan

alperyazgan commented Aug 21, 2017

Issue summary

In the following simple writer setting, CSV insistingly creating file with delimiter comma (default)

...
{
$writer = Writer::createFromPath($tmpFile, 'w+');
RFC4180Field::addTo($writer);
// $writer->setEnclosure('"');
$writer->setDelimiter('|');
echo $writer->getDelimiter(); // Prints "|" correctly

// $writer->setEscape('\');
$writer->setNewline("\r\n");
$writer->insertOne($this->getColumnListing());
$this->query()->orderBy($this->getKeyName())->chunk($this->getExportChunkSize(), function ($items) use ($writer) {
$items->each(function ($item) use ($writer) {
$writer->insertOne($item->getAttributes());
});
});
}
...

System informations

PHP 7.1.8-1+ubuntu16.04.1+deb.sury.org+1 (cli) (built: Aug 3 2017 18:37:39) ( NTS )

CSV version from composer.json
"extra": {
"branch-alias": {
"dev-master": "9.x-dev"
}
}

@nyamsprod nyamsprod self-assigned this Aug 21, 2017

@nyamsprod nyamsprod added the bug label Aug 21, 2017

@nyamsprod

This comment has been minimized.

Show comment
Hide comment
@nyamsprod

nyamsprod Aug 21, 2017

Member

@alperyazgan thanks for reporting this bug a fix is on its way 👍

Member

nyamsprod commented Aug 21, 2017

@alperyazgan thanks for reporting this bug a fix is on its way 👍

nyamsprod added a commit that referenced this issue Aug 21, 2017

@alperyazgan

This comment has been minimized.

Show comment
Hide comment
@alperyazgan

alperyazgan Aug 21, 2017

And the enclosure has the same problem ...

alperyazgan commented Aug 21, 2017

And the enclosure has the same problem ...

@nyamsprod

This comment has been minimized.

Show comment
Hide comment
@nyamsprod

nyamsprod Aug 21, 2017

Member

Yes all CSV controls are fixed in the patch . It is taking a bit of time because github has some issues right now. I'll put it on prod ASAP.

Member

nyamsprod commented Aug 21, 2017

Yes all CSV controls are fixed in the patch . It is taking a bit of time because github has some issues right now. I'll put it on prod ASAP.

@alperyazgan

This comment has been minimized.

Show comment
Hide comment
@alperyazgan

alperyazgan commented Aug 21, 2017

Thanx

@nyamsprod

This comment has been minimized.

Show comment
Hide comment
@nyamsprod

nyamsprod Aug 22, 2017

Member

version 9.0.1 is released.

@alperyazgan Of note, in your example the RFC4180Field filter may not work as intended as you are setting your delimiter after adding the filter. You should add the filter once you have sets your CSV controls otherwise the results may be unexpected.

Member

nyamsprod commented Aug 22, 2017

version 9.0.1 is released.

@alperyazgan Of note, in your example the RFC4180Field filter may not work as intended as you are setting your delimiter after adding the filter. You should add the filter once you have sets your CSV controls otherwise the results may be unexpected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment