0

I am using Feed import to load a CSV file exported from an SQL database into Drupal and I am stuck at the stage where I need to map the CSV field names to the Drupal content type field names.

I think there as to be some stage in the process where in some form or dialog I can input a list of the CSV field headers and proceed to a form which enables me to match the CSV headers to the field names of the content type, but I can't find such a page in the list of pages I have to follow.

I am sure I have followed the Feed Importer creation process properly. Am I missing something, or this capability not included in the Feeds CSV importing system??

1
  • I have checked and the Feeds CSV import does not load some sample data to get the field list. Feeds SQL loads the first 10 records at the design phase to get the field names and thus makes the mapping easier.
    – vfclists
    Jun 1, 2014 at 20:24

2 Answers 2

2

https://www.isovera.com/blog/using-feeds-module-bulk-import-drupal-7

This is what I used...worked like a charm...you simply need to map field names from CSV file to node fields...

Alex

1
  • I think I didn't explain myself well enough, but as your answer fits the way I phrased the question I have marked it as the right answer. The Feeds Import system doesn't have the capability to load the list of CSV field names to be mapped. They have to be manually added one at a time, but the table I am importing has many fields and that approach is tedious.
    – vfclists
    May 27, 2014 at 22:15
1

The checkbox setting "has header" or "has no header" is important. This tells Feed importer if the first line has to be treaded as field names. In the mapping step of the Feed import settings you tell Feed importer wich field name in the header covers which fields in the given content type. Or you choose no header, what means no field names are given. In this case Feed importer tries to import regarding the sorting of the fields in the csv and in your mapping (left and right). IF your CSV data are sorted the same way like the fields you have activated in the mapping settings, it will try to import the fields in order then.

But if you look for a completely automated way, where Feeds automaticly "know" which fields do you mean, I am sorry to say that, but I think this is impossible. There is always a moment in an import process, when you have to manually map or order things. Otherwise an import is impossible. But not from the limits of the module but rather from the logic of how import works.

4
  • The need to add all the CSV field names manually is a shortcoming. I am looking at Feeds SQL and it appears that when it comes to the mapping phase it limits the output to 10 records to obtain the list of field names. The Feeds CSV should be able to do that as well.
    – vfclists
    May 28, 2014 at 16:08
  • 2
    I had much more than 10 fields per dataset already imported. Hm. Which version of Feeds do you use? And are we talking about the same when we talk about "fields"? How many fields can ONE dataset have? Most common way to organise data is to split them into different data type sets and build relations. I have never seen ONE dataset which had more than 10-30 fields. I am not sure if we don't talk about datarows (datasets) here. In other words asked: How many columns and rows would your spreadsheet have, if you would put your csv in a table?
    – nilsun
    May 28, 2014 at 17:22
  • The table in question has 55 fields, and it is device and customer data. The problem here about organizing data in a relational manner is that you don't always get to choose, and Drupal is not particularly designed for relational data, and neither is its UI
    – vfclists
    Jun 1, 2014 at 20:20
  • 1
    Ok but what ever you want to achieve, an import keeps being an import and a system needs to know what & where. We may discus to general here now. CSV can't be relational. It's flat, fields per row. So you may have to split the import into relational sets? Drupal is fine for relational data (We run a complex EDP with it) but as I sad, for flat import you can choose using import without header row, play with field order. Or you 're looking for a way to create fields by import? I don't know. But I think it's rather a question of concept to achieve this another way around...
    – nilsun
    Jun 2, 2014 at 5:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.