I am a novice Drupaler looking for a solution for importing CSV files into my drupal installation. Up until now I have been unsuccessful.

First, I setup a "new content type" containing all of the fields that I want to populate.
Next, I created a custom CSV importer using the Importer module as follows:

Basic settings set to "standalone form" with Periodic Import set to "off".
Fetcher is set to file upload with "Settings for File Upload" with "Allowed file extensions" set to: txt csv tsv xml opml xls.
Parser is set to "CSV parser".
Processor is "Node parser" with settings of "Plain Text" and "Content type" set to my "new content type".
Mapping for the "Node processor" is composed of 6 values with source and target set to corresponding fields.

I have two csv files containing the same data and column headings, one created with MS Excel and the other created with LibreOffice Calc
When I run the importer function (using either file) I always get this - "Status * No imported items.

My Module List: CTools, Job Scheduler, Feeds, Feed Import, Importer, Feeds Admin UI, Feeds Import, Feeds XLS, Feeds Tamper, Feeds Tamper UI, Importer, Node Reference, and PHPExcel Library.

After considerable effort I am still unable to get this right. It is new to me and I have done a lot of research before reaching out for assistance.I have added a tutorial video link in reference; it is the only tutorial I could find that demonstrates a procedure for this, and I still can't get it done! Is there anybody who has accomplished this on a a consistent basis who can shed light on how to do it?

Reference Link: Importing CSV Data Using Feeds-Drupal 6 Video

Comments

stugacz’s picture

Project: Feed » Feeds
Issue summary: View changes

Update.

stugacz’s picture

Issue summary: View changes

Update.

stugacz’s picture

Title: Problem Importing CSV Files Using Feeds » CSV Importer Status: No imported items. (This does not work)
Project: Feeds » Feed

I have followed all available directions. Nothing works!

ashrafabed’s picture

Hello! I was just having this same problem, and now I have a new one to tackle. Anyways, this is how I got past that problem:
Instead of uploading my csv file from my hard drive, I created a folder in Drupal's root directory called 'import', changed my csv upload method from upload to supply URL, and then I accessed the csv file using the new settings and supplying the link rather than trying to upload it from my hard disk. It at least made an effort to upload my csv file that time. Good luck, let me know if I was unclear.

skari’s picture

I am having exactly the same issue.
And the worst thing is that there are absolutely no error message or anything showing up to help in debugging this.

It is a shame that the old node_import module has been discontinued in favor for this crap.
It is a pain to work with this module. I have now spent 1 and 1/2 day on importing data. Stuff that would have taken me 15 minutes using Drupal 6 and node_import

skari’s picture

Just want to appologize for the harsh words. The Feeds module is not crap. It is well written, and designed. It just lacks some features.
Also, I finally managed to get this working, sort of.

I cleared everything I had, donwloaded the latest dev build, and skipped enabling the demonstation module, and created my Feed from scratch. Then I was able to import some nodes

But I still have some issue, that I'll have to solve in code, or by using Feed Tamper.
The node_import module was/is a great module for importing csvs and tab delimted files. The wizard for defining input files was great. I think the Feeds module needs an interface like that.

Cheers,
skari

shiraz dindar’s picture

hey skari, do you have "Import on submission" checked in the Basic settings of the importer?

skari’s picture

Hi Shiraz,

As I said I scrapped my former config and reinstalled the Feeds module, so I am not sure if that was the issue. But that seems like a good explanation.

I ended up writing a whole lot of code for importing my data. I found it absolutely necessary as it is very difficult and time consuming to manipulate the import template using the default user interface. If one makes a mistake or needs to make adjustments (for example alter the order of fields), one basically has to scrap the import def, and start anew. It is way better to implement an importer_default hook. Then I also wrote a lengthy tagets_alter. Much simpler than to use the Feeds tamper module.

Cheers,
skari

shiraz dindar’s picture

ok, well this sounds too late and probably unrelated, but fwiw, i had a similar issue to yours, and aside from the setting above, what i had to do was open up the perms on the csv feed. when i loaded the csv file from my browser, i saw a fully populated spreadsheet -- because i was logged in to the drupal site that was generating the CSV. but the feeds importer, when fetching the CSV file was naturally not logged in, so it pulled an empty spreadsheet and reported "no imported items"... maybe this will help someone else.

shiraz dindar’s picture

as to the order of mappings in the feeds definition, i too noted this is a regression from previous versions of feeds where you were able to reorder the mappings. however, this has no impact on the actual import. it just looks less organized.

i've found that feeds tamper is good for most manipulations you might need to do, and if not, it's simple to write a plugin for it.

in any case, i'm glad that using the hooks worked for you.

c0ldfury’s picture

The uploaded csv needs to be utf-8 encoded. Feeds can't handle it otherwise.

extexan’s picture

I'm having the same problem. I've tried ALL the suggestions above, to no avail.

Anyone else still having problems with this?

wusel’s picture

chris.gr’s picture

Is it necessary to enable the checkbox "Import on submission" when the standalone form is chosen as content type?

If I do this and click on the "Import" button, the error message "you do not have the rights to access this page" is displayed. I am logged in with the admin user and enabled all rights in the different modules.

If I do not enable the checkbox "Import on submission" no items are imported when clicking the button "import".

chris.gr’s picture

Is it necessary to enable the checkbox "Import on submission" when the standalone form is chosen as content type?

If I do this and click on the "Import" button, the error message "you do not have the rights to access this page" is displayed. I am logged in with the admin user and enabled all rights in the different modules.

If I do not enable the checkbox "Import on submission" no items are imported when clicking the button "import".

wusel’s picture

My link in #11 says:

The needed/correct line-ending-char(s) of a Feeds-imported CSV-file depends on the type of the operating system of the www-server:
If you are using a Linux-Server, use only "LF" at the line-end of the CSV-file.
If you are using a Windows-Server, use "CR+LF" at the line-end of the CSV-file.
If you are using a Mac-Server, use only "CR" at the line-end of the CSV-file.
The changing of the line-end of the CSV-file before importing is important, if the source of the CSV-file (e.g. your computer or the database of the CSV-file) has a different operating system!

You can use a good editor like 'notepad++' on windows or 'LibreOffice Calc' (when indicated: '... Portable') or 'MS Excel' to change this (Tip: use "Save as" and change the needed properties before/during saving).

I think, this is your problem: the line ending char(s) is/are not correct.

Good luck!

kclarkson’s picture

I have been trying for hours and I cannot get this to work either. The crazy part is that I had them working at one point but now I cannot.

The error i am receiving is:
SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1

I have gone through all the steps a bunch of times. guid - set to unique, all others mapped.

FIXED: Automatic Node Titles were on. Once I disabled this everything was imported correctly.

kclarkson’s picture

Project: Feed » Feeds
Version: master » 7.x-2.0-alpha7

assuming the project name should have been feeds.

marty.true’s picture

@c0ldfury you're a life-saver!
I messes with this for over an hour and couldn't figure out why it kept saying "no nodes imported" so I ran it through Text Wrangler and force-saved as UTF-8 and it worked perfectly!!!

wusel’s picture

Title: CSV Importer Status: No imported items. (This does not work) » CSV Importer Status: No imported items. [solved]

My link in #11 says:

When the Feeds-imported CSV-file is in "UTF8 with BOM"-format, then the import of special characters (letters like €, £, ß, ö ,ü, ä, Ö, Ä and Ü or other non-ASCII-signs) is without problems. See also UTF8 - Byte order mark on Wikipedia

UTF8 is not ASCII and is not standard-windows format. Change the format of your data, that comes from a windows computer!
But it is better to use "UTF8 with BOM"-format.

Good luck!

Wusel

wusel’s picture

Issue summary: View changes

Update

twistor’s picture

Component: User interface » Documentation
Status: Active » Closed (duplicate)
Perseids’s picture

In case it helps anybody I had a similar problem and found out it had nothing to do with CSV line-breaks (which were outputted correctly by Excel for a windows sever), but it was a database issue.

My problem was that the content type I was trying to import had an issue with one of the non-mandatory taxonomy field (the feed Import worked fine for every other content type except this one). And when I tried to add content manually to this content type while leaving the non-mandatory taxonomy term field empty I ran into this error msg: "PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: 'autocreate' for column..". Which led me to this topic, and all I had to do to solve this error was re-saving the "Edit", "Settings" and "Widget type" for the faulty taxonomy field.

Then I was able to create the content type manually without the non-mandatory field, and feed-importer also worked.

Dmor5745’s picture

Problem was fixed for me by checking (enabling): "Import On Submission"

surfgatinho’s picture

Check your max post size in PHP too. That's what was causing the issue for me.

ksi’s picture

I had the same problem with setting 'File upload' for Feeds fetcher. Checking option
'Supply path to file or directory directly' and manually uploading the file works.

May be the reason is with 'File upload' that for the uploaded file value 'application/octet-stream' is set in column 'filemime' of db table 'file_managed.