ddeboer / data-import

Import data from and export data to a range of different file formats and media
MIT License
567 stars 123 forks source link

CsvReader detecting new lines #264

Open kuzmamar opened 8 years ago

kuzmamar commented 8 years ago

Directive ini_set('auto_detect_line_endings', true); in CsvReader constructor does not work. The directive should be used before creation of \SplFileObject otherwise it detects nothing. I found this when trying to read a file with '\r' as a new line.

rimantoro commented 8 years ago

I also have issue with this also. My current solution is, to put code below before \SplFileObject initialized

ini_set('auto_detect_line_endings', true);
$file = new \SplFileObject($yourFilePath);
kyleobrien91 commented 8 years ago

@kuzmamar - could you perhaps open a PR for your suggested change?