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

Infer CSV delimiter if it hasn't been set explicitly #141

Closed
wants to merge 4 commits into from

Conversation

lanthaler
Copy link
Contributor

This change tries to infer the delimiter if it hasn't been explicitly set. It first counts the number of occurrences of a number of potential delimiters (max. first 1000 lines) of a CSV file and then chooses the one which occurs most regularly (mean square deviation).

@PowerKiKi
Copy link
Member

Looks good to me, but we miss unit tests to be merged. Could you please add some, most likely in PhpOffice\PhpSpreadsheetTests\Reader\CsvTest and if you need CSV files maybe put them in tests/data/Reader/Csv ?

@PowerKiKi PowerKiKi added the reader/csv Reader for CSV files label Apr 18, 2017
@lanthaler
Copy link
Contributor Author

@PowerKiKi, thanks. I added a test.

@PowerKiKi PowerKiKi closed this in 3ee9cc5 Apr 20, 2017
@PowerKiKi
Copy link
Member

Thanks for your contribution !

I added a bit of documentation and changelog and merged everything as a squashed commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reader/csv Reader for CSV files
Development

Successfully merging this pull request may close these issues.

2 participants