Skip to content
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

CSV delimiter counting can't handle line breaks inside an enclosure #716

Closed
thisispaul opened this issue Oct 9, 2018 · 0 comments
Closed

Comments

@thisispaul
Copy link
Contributor

thisispaul commented Oct 9, 2018

This is:

- [X] a bug report

What is the expected behavior?

When counting delimiters of a CSV that has text with line breaks inside an enclosure it should not count the lines inside the enclosure as separate lines when calculating its deviation.

What is the current behavior?

If you have a file like Delimiter Test.txt which has line breaks in it. It incorrectly determines the delimiter as " " and not ",".

What are the steps to reproduce?

Parse this CSV

Name,Copy,URL
Test,"This is a test
this is a test
with line breaks
that breaks the
delimiters",https://google.com
Test,"This is a test
this is a test
with line breaks
that breaks the
delimiters",https://google.com
Test,"This is a test
this is a test
with line breaks
that breaks the
delimiters",https://google.com
Test,"This is a test
this is a test
with line breaks
that breaks the
delimiters",https://google.com

Then it determines the delimiter as a space and not a comma.

Which versions of PhpSpreadsheet and PHP are affected?

PhpSpreadsheet - 1.4.1
PHP - 7.2

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

No branches or pull requests

1 participant