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

joachim’s picture

I'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.

mikeryan’s picture

Status: Active » Postponed (maintainer needs more info)

Having 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.

joachim’s picture

Is 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.

mikeryan’s picture

Title: CSV import doesn't properly recognize columns » CSV import needs to handle incompatible line endings
mikeryan’s picture

Status: Postponed (maintainer needs more info) » Active
mikeryan’s picture

Priority: Critical » Normal
guip’s picture

I don't know if it help but changing the lin ending to windows CRLF on my CSV works for me.