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
Comment #0.0
stugacz commentedUpdate.
Comment #0.1
stugacz commentedUpdate.
Comment #1
stugacz commentedI have followed all available directions. Nothing works!
Comment #2
ashrafabedHello! 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.
Comment #3
skari commentedI 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
Comment #4
skari commentedJust 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
Comment #5
shiraz dindarhey skari, do you have "Import on submission" checked in the Basic settings of the importer?
Comment #6
skari commentedHi 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
Comment #7
shiraz dindarok, 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.
Comment #8
shiraz dindaras 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.
Comment #9
c0ldfury commentedThe uploaded csv needs to be utf-8 encoded. Feeds can't handle it otherwise.
Comment #10
extexan commentedI'm having the same problem. I've tried ALL the suggestions above, to no avail.
Anyone else still having problems with this?
Comment #11
wusel commentedPlease look at http://drupal.org/node/622710#csv
Comment #12
chris.gr commentedIs 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".
Comment #13
chris.gr commentedIs 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".
Comment #14
wusel commentedMy link in #11 says:
I think, this is your problem: the line ending char(s) is/are not correct.
Good luck!
Comment #15
kclarkson commentedI 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.
Comment #16
kclarkson commentedassuming the project name should have been feeds.
Comment #17
marty.true commented@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!!!
Comment #18
wusel commentedMy link in #11 says:
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
Comment #18.0
wusel commentedUpdate
Comment #19
twistor commented#1428272: Added support of encoding conversions to the CSV Parser
Comment #20
Perseids commentedIn 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.
Comment #21
Dmor5745 commentedProblem was fixed for me by checking (enabling): "Import On Submission"
Comment #22
surfgatinho commentedCheck your max post size in PHP too. That's what was causing the issue for me.
Comment #23
ksi commentedI 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.