Drupal CSV import and create nodes I am trying to accomplish the following through feeds and want to know if this is possible.


Setup a cron to pull a CSV file via ftp from another server daily
Create a bunch of nodes with custom fields based off the CSV file 


I have the latest Feeds module setup, When I go to create a node it says I can upload my CSV file, however it seems the mapping could be wrong? I was a little confused at when I was setting up the mapping. My CSV file has no headers so for the source I put in the Column Name i.e A, B, C etc.

What am I doing wrong?

Link to CSV: http://markets.naptiveagency.com/diamondlot.csv
In order to do the mapping correctly, you have to instruct the feed importer how to do it. This is done through the configuration steps, shown in the following screenshots: 

For sake of simplicity and time saving, I have created a content type called i.e. SimpleCar and added all the fields from the CSV file with the same name. Here is the screenshot of the content type: 



Once you created a content type that closely correspond the screenshot shown above, then install/enable the following modules namely feed, feeds_ui,job_scheduler. And create a feed with the following configuration screens (closely watch how the feed is configured to read the CSV - Comma seperted file). 



For simplicity, I have used the Standalone Form to directly upload the CSV. If you want this process to be triggered by CRON then you need to attach it to a content type - from the list). 

You can also set the periodic import and tick the process in background option, you must have the CRON already configured. 

Click on Fetcher and select either File Upload or HTTP, in this test case I have chosen File Upload, Save. 

Once saved then you will see the File UPload Settings, Click it and see what is there. You can leave this settings intact. You can also tick the tick-mark to indicate where the feed importer should automatically pick up the CSV file and process it (should you have a way to automatically store the csv file in a directory then importer can pick it from there - that is advanced, you need to read about it). 

Click on Parser and select CSV parser then SAVE. Once SAved then you will see the CSV Parser settings. By default it looks for Comma seperated, leave this intact and Save it. If you notice in this settings, there is a tick mark for Header, if you tick that then feed importer will start from top-most row, if you don't select it then first row will be skipped. 

Click on Processor settings and choose Node Processor, Save. Once saved the Node Processor settings will appear and it has two sub-settings, Settings and Mapping. 

The settings for this example, look as follow: 



I have chosen Bundle as SimpleCar (which is the Drupal content type). This says that for every row of the CSV create one of the SimpleCar node. Save this screen. 

The mapping settings of Node Processor should look as follow, to avoid mistakes, I recommend that you copy/paste fields directly from CSV and map them to their corresponding SimpleCar content type fields. Don't forget to map a unique value as VIN to GUID and Title and then Save. 

Now go back to the basic settings and there is a link under the Standard Form drop down, you can use that link to upload your CSV and it should process and create your drupal nodes. 

See my results: 



and here is how the node looks like 



In case you are lazy to follow the instructions, then at least create the content type and import the following code to Feeds using Import feed functionality and give it ago. You can then customize this to do it for you automatically either via HTTP download from server or pick up the CSV file from a location. You of course need to do some reading, google, there are a thousand tutorials on feeds module. 

$feeds_importer = new stdClass();
$feeds_importer-&gt;disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer-&gt;api_version = 1;
$feeds_importer-&gt;id = 'csv_importer';
$feeds_importer-&gt;config = array(
  'name' =&gt; 'CSV Importer',
  'description' =&gt; 'Testing CSV Importer',
  'fetcher' =&gt; array(
    'plugin_key' =&gt; 'FeedsFileFetcher',
    'config' =&gt; array(
      'allowed_extensions' =&gt; 'txt csv tsv xml opml',
      'direct' =&gt; FALSE,
      'directory' =&gt; 'public://feeds',
      'allowed_schemes' =&gt; array(
        0 =&gt; 'public',
      ),
    ),
  ),
  'parser' =&gt; array(
    'plugin_key' =&gt; 'FeedsCSVParser',
    'config' =&gt; array(
      'delimiter' =&gt; ',',
      'no_headers' =&gt; 0,
    ),
  ),
  'processor' =&gt; array(
    'plugin_key' =&gt; 'FeedsNodeProcessor',
    'config' =&gt; array(
      'expire' =&gt; '-1',
      'author' =&gt; 0,
      'authorize' =&gt; 1,
      'mappings' =&gt; array(
        0 =&gt; array(
          'source' =&gt; 'DEALERSHIP_ID',
          'target' =&gt; 'field_dealership_id',
          'unique' =&gt; FALSE,
        ),
        1 =&gt; array(
          'source' =&gt; 'STOCKNUMBER',
          'target' =&gt; 'field_stocknumber',
          'unique' =&gt; FALSE,
        ),
        2 =&gt; array(
          'source' =&gt; 'new',
          'target' =&gt; 'field_new',
          'unique' =&gt; FALSE,
        ),
        3 =&gt; array(
          'source' =&gt; 'VIN',
          'target' =&gt; 'field_vin',
          'unique' =&gt; FALSE,
        ),
        4 =&gt; array(
          'source' =&gt; 'Year',
          'target' =&gt; 'field_year',
          'unique' =&gt; FALSE,
        ),
        5 =&gt; array(
          'source' =&gt; 'Make',
          'target' =&gt; 'field_make',
          'unique' =&gt; FALSE,
        ),
        6 =&gt; array(
          'source' =&gt; 'Model',
          'target' =&gt; 'field_model',
          'unique' =&gt; FALSE,
        ),
        7 =&gt; array(
          'source' =&gt; 'series',
          'target' =&gt; 'field_series',
          'unique' =&gt; FALSE,
        ),
        8 =&gt; array(
          'source' =&gt; 'Body',
          'target' =&gt; 'field_body',
          'unique' =&gt; FALSE,
        ),
        9 =&gt; array(
          'source' =&gt; 'Ext Color',
          'target' =&gt; 'field_ext_color',
          'unique' =&gt; FALSE,
        ),
        10 =&gt; array(
          'source' =&gt; 'Int Color',
          'target' =&gt; 'field_int_color',
          'unique' =&gt; FALSE,
        ),
        11 =&gt; array(
          'source' =&gt; 'Asking Price',
          'target' =&gt; 'field_asking_price',
          'unique' =&gt; FALSE,
        ),
        12 =&gt; array(
          'source' =&gt; 'MILEAGE',
          'target' =&gt; 'field_mileage',
          'unique' =&gt; FALSE,
        ),
        13 =&gt; array(
          'source' =&gt; 'Transmission',
          'target' =&gt; 'field_transmission',
          'unique' =&gt; FALSE,
        ),
        14 =&gt; array(
          'source' =&gt; 'Engine',
          'target' =&gt; 'field_engine',
          'unique' =&gt; FALSE,
        ),
        15 =&gt; array(
          'source' =&gt; 'restraint type',
          'target' =&gt; 'field_restraint_type',
          'unique' =&gt; FALSE,
        ),
        16 =&gt; array(
          'source' =&gt; 'image url',
          'target' =&gt; 'field_image_url:url',
          'unique' =&gt; FALSE,
        ),
        17 =&gt; array(
          'source' =&gt; 'Comments',
          'target' =&gt; 'field_comments',
          'unique' =&gt; FALSE,
        ),
        18 =&gt; array(
          'source' =&gt; 'options',
          'target' =&gt; 'field_options',
          'unique' =&gt; FALSE,
        ),
        19 =&gt; array(
          'source' =&gt; 'certified',
          'target' =&gt; 'field_certified',
          'unique' =&gt; FALSE,
        ),
        20 =&gt; array(
          'source' =&gt; 'VIN',
          'target' =&gt; 'guid',
          'unique' =&gt; 1,
        ),
        21 =&gt; array(
          'source' =&gt; 'VIN',
          'target' =&gt; 'title',
          'unique' =&gt; FALSE,
        ),
      ),
      'update_existing' =&gt; '2',
      'input_format' =&gt; 'plain_text',
      'skip_hash_check' =&gt; 0,
      'bundle' =&gt; 'samplecar',
    ),
  ),
  'content_type' =&gt; '',
  'update' =&gt; 0,
  'import_period' =&gt; 1800,
  'expire_period' =&gt; 3600,
  'import_on_create' =&gt; TRUE,
  'process_in_background' =&gt; FALSE,
);