Skip to content
This repository has been archived by the owner on Jan 2, 2019. It is now read-only.

Enable enclosure to be optional in CSV writing #282

Open
mvl22 opened this issue Dec 8, 2013 · 5 comments
Open

Enable enclosure to be optional in CSV writing #282

mvl22 opened this issue Dec 8, 2013 · 5 comments

Comments

@mvl22
Copy link

mvl22 commented Dec 8, 2013

It is useful sometimes when writing CSV files to be able to avoid the "" enclosure if the cell is empty or if the cell content doesn't actually contain the delimiter character.

This can substantially reduce the file size, and increase readability, especially when the CSV file is large.

A previous report on this is at: http://phpexcel.codeplex.com/workitem/17597 :

Currently a line of output might appear like this:

"1","Hello, John","This is Mark",""

With a simple change this could be made optional, i.e.

1,"Hello, John",This is Mark,

which I believe is valid CSV and would be closer to what alot of other CSV writing programs output.

The relevant code is at:
https://github.com/PHPOffice/PHPExcel/blob/develop/Classes/PHPExcel/Writer/CSV.php#L297

@sbrowett
Copy link

+1 from me, this is causing me issues now on a project, which would otherwise be trivial!

@mvl22
Copy link
Author

mvl22 commented Oct 18, 2016

There is a pending pull request at #283.

@PowerKiKi
Copy link
Member

PowerKiKi commented Oct 18, 2016

@sbrowett, @mvl22 if one of you can rebase the PR on https://github.com/PHPOffice/PhpSpreadsheet develop branch (respecting new code formatting), then I'll merge it over there.

@mvl22
Copy link
Author

mvl22 commented Oct 18, 2016

@chupacabrot
Copy link

Hmm.. so, is there any update on this one?
Still can't find how to remove this enclosure.. it's making me a huge mess in one of my projects that is relying on google's adwords editor that for some reason refuses to import a CSV which includes these enclosures.. and i would really love to avoid the replace-all thingy every time.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants