I import a file of approx. 20 fields, with 101 records.
The file is CSV tab delimited.
It stops after 79 records and puts ALL the remaining 22 records inside the last field (Notes field, which should be empty in the CSV) - with no stopping, commas or anything, just a dump of all the remaining records into the last field of record #79...

I see it also in the preview - when I asked to see preview of 150 records...

I try to reduce the size and then it does the same just after less records (like 15 or so).
I try to load it with Open Office and save it and it still didn't help...

Attached is a screenshot of the preview. The bug appeared in rc4 and in the dev version.

Comments

tierecke’s picture

I made sure that the last field (notes) is not empty (put asterisk instead) and then the import went fine.
Without it - it still stops after exactly 79 records out of 101, even if I change the order of the records.

coloryan’s picture

I've imported over 1500 taxonomy terms, parent/child structure, as well as a few hundred terms/definitions, with no issue. Without looking at your import, I'm tempted to say that it's a local issue, not a bug.

tierecke’s picture

I've also imported 3000 records with no problem.
But do like this: put a last columns in your CSV and populate it very sparesly and see what happens.
I suspect you'll face also something like that. Try it - I'm curious to know if it occurs also to you.

When I made sure that all the values in the last field are not empty, it went smoothly.
Without it - I tried saving it with Excel, Open Office, changed with VI, did with Java, swapped records - nothing helped. The records that were imported well in the 1st import because they were in the front, didn't import when when they were in the back.

coloryan’s picture

Ah, I understand now. I occasionally had the same issue. I resolved it by putting a '-' in every empty cell. It's not the ideal solution, but it worked for me.

juicytoo’s picture

you can also set up default values before data population.

that should also help the parser.

tierecke’s picture

I don't want to have any default value. I want that an empty cell will remain empty.
I imported it with * in the empty cells and then changed it inside Drupal,
but it's a major bug and it took me over a day to realize what to do.

coloryan’s picture

I imported 15 stories this morning, with several empty cells (weight, things like that), and I didn't have any errors associated with them.

Sorry, I'm not sure I can help any more as I can't get the error to replicate.

authored on,weight,Published On
,2009-07-28 05:30:45,,2009-07-28 05:30:45

tierecke’s picture

coloryan, try importing a tab delimited file, with no text delimiter, and leave the last field empty...
I am quite sure it'll make you reproduce the bug.

Mixologic’s picture

I am having the exact same issue. I kept splitting my file, reordering the file to no avail. It alwasy stopped about 19 records short of the eof. Thanks a *BUNCH* for figuring this one out tierecke. This is definitely a bug. Its not just "any empty cells", its when the *very last* field is empty in the csv file. Im pretty sure it will happen if the input line *ends* with a delimiter.

Whew.. I thought I was gonna have to debug this one myself..

kruser’s picture

Title: Node Import stops after 79 records out of 101... » Last field cannont be empty

This issue should have a big red asterisk next to it. I spent the last 2 hours combing through my csv file looking for problems when there wasn't a problem at all. Node Import stops importing if the last field in the current row is empty! So i'm adding a "IF(1<2,'***','') as last_column_filler" to make a generic last column in all of my import scripts.

kruser’s picture

Title: Last field cannont be empty » Last field cannot be empty
Syg’s picture

I have the same problem here :

a;b;c => works well
a;;c => is also good
a;b; => error because the line ends with a ';'

I added a debug column at the end of the csv file which is never empty, waiting for a fix.
a;b;;debug_value

herpderp’s picture

Subscribing.

soxofaan’s picture

StatusFileSize
new327 bytes

(Subscribing)
I also lost hours investigating this issue. Thanks for the workaround with adding a dummy last column.

In attachment an example file illustating the bug:
header + 20 entries (two columns "Title" and "Body")
importing results in only 18 new records
18th imported records consumes, apart from 18th entry from CSV, also 19th and 20th entry in its body

Robrecht Jacques’s picture

Status: Active » Fixed

Fixed in -dev. Will be included in -rc5.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.