Search form

Update/edit nodes from source CSV data using FeedAPI?

My scenario: We are using Excel spreadsheets to keep track of the 2000+ semi-trailers in our yards. We want to switch to Drupal to track this data. However, updating Drupal Nodes is far more time-consuming for our data entry personnel than editing a spreadsheet.

So here is my thought: Why not have Drupal import the data from a CSV file? This way, the data entry personnel can continue updating a spreadsheet, yet the data will be brought into Drupal on a cron basis using FeedAPI and CSV parser.

Each semi-trailer in our inventory has its own Drupal node, with various CCK fields attached to it. I would like to have this node's CCK values updated with data from the CSV file each time that trailer appears in the file.

How do I accomplish this? What modules should I use? How would I configure them?

Looks like the Feeds project will work for my needs. I notice that only URL and GUID can be a "unique target" for Feeds CSV imort. I have a CCK field that is unique to each node (enforced via the Unique field module). Can I make that a 'unique target' for my CSV import?

Each of my nodes has a unique 'unit id' CCK field. I would like Feeds to (1) look at my CSV file and find the column mapped to the unique target ('unit ID'), (2) match that to the unique 'unit ID' CCK field of an existing node, then (3) update that node with the rest of the CSV data in that row that is mapped to the node's CCK fields.

This will allow me to achieve my goal of having data entry personnel update a CSV and have that data imported into my Drupal nodes via feeds.

You could skip the feed step and write a module to take the data from csv on cron. You could read the csv file for the unique id, query the database for the node id of the unique id, load the node by node id, then update its fields and save the node.

Except I would change the code to use hook_cron inside a module rather than editing the cron.php that comes with Drupal. http://api.drupal.org/api/function/hook_cron/6 And this would I think also require staff or automated procedure to export the Excel spreadsheet to a csv file daily or however often you need it.

Pardon my ignorance as I'm a newbie to Drupal and not very skilled at php or server administration.

I am trying to get this script to work but am having no luck. I have this module installed in /sites/all/modules/updatedata and it is enabled on the Modules page. I upload the file "mth_update.php" to the root of my Drupal installation. (It is a multi-site install, and I will only use this module on this site - should I put it in /sites/[siteurl]/modules and upload the mth_update to the root of that site?) Then I go to http://[siteurl]/cron.php, I get a WSOD, then go back to http://[siteurl] and everything looks fine but the update to the nodes did not happen. I believe the module is running on hitting cron.php because I was getting errors about field names, but then used the Devel module to get the names of the CCK fields. I have cleared the cache between each try. There are no apache errors nor errors in the watchdog list but it is not updating the nodes.

Hi I have successfully added values ,taxonomy to node by using node_save .

But I am looking to your solution .
I have created a separate column in excel named unique id and also add a field in my content type.
And if both id match then update node otherwise create a new node,