Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
My CSV looks like this:
email,region
foo.bar@example.com,North West
biz.bax@another.co.uk,South East
third@thing.com,East
[lots more rows]
DB table ends up like:
email,region
foo.bar@example.com,North West biz.bax@another.co.uk
truncated@email.com,North anotheremail.com
where I have only 2 DB rows and the 2nd row is from way way down in my CSV.
Comments
Comment #1
joachim CreditAttribution: joachim commentedI've enclosed the region names in double quotes to be sure it's not the spaces causes problems.
Same kind of result.
My file is using UNIX line endings, so I don't think it's anything to do with that.
Comment #2
mikeryanHaving text from one line end up in a data column for the previous line almost certainly has something to do with line endings. Try adding
php_value auto_detect_line_endings 1
to your .htaccess file. If that doesn't work, can you attach a short version of your file (just a few rows, change emails to example.com, etc.) that produces the problem?
Thanks.
Comment #3
joachim CreditAttribution: joachim commentedIs there a way for the module code to address this?
I used http://drupal.org/project/node_import for Drupal 5 last year and the code for that goes through a few hoops to fix PHP's problems with CSV files.
Comment #4
mikeryanComment #5
mikeryanComment #6
mikeryanComment #7
guip CreditAttribution: guip commentedI don't know if it help but changing the lin ending to windows CRLF on my CSV works for me.