10 of 14
10
Plugin: CSVGrab
Posted: 18 July 2008 08:45 AM   [ Ignore ]   [ # 163 ]  
Grad Student
Rank
Total Posts:  69
Joined  12-14-2007

Hi

Im not sure if this is the right place to post this sorry if its not, i followed the tutorial on how to set up the CSVGrab, but when i have gone to test I get the following error (swapped site name for mysite)


Warning: fopen(mysite/DFS.csv) [function.fopen]: failed to open stream: Connection refused in /home/sites/mysite/public_html/office/plugins/pi.csvgrab.php on line 192

Warning: fgetcsv(): supplied argument is not a valid stream resource in mysite/public_html/office/plugins/pi.csvgrab.php on line 202

Warning: fclose(): supplied argument is not a valid stream resource in mysite/public_html/office/plugins/pi.csvgrab.php on line 478

am i missing something??

L

Profile
 
 
Posted: 18 July 2008 08:48 AM   [ Ignore ]   [ # 164 ]  
Lab Assistant
RankRank
Total Posts:  165
Joined  12-21-2005

It looks like the plugin is not finding the CSV file.

Try using a URL (eg, http://msysite.com/mycsvfile.csv) or an absolute path (eg, /home/youracct/mycsvfile.csv)

 Signature 

Andrew Weaver — brandnewbox.co.uk


Member of EE Professional Network · More plugins, extensions and modules · Documentation

Profile
 
 
Posted: 18 July 2008 08:52 AM   [ Ignore ]   [ # 165 ]  
Grad Student
Rank
Total Posts:  69
Joined  12-14-2007

Cheers

That worked a treat. I was using the url but have changed to an absolute path and it seems to be working

Thanks smile

Profile
 
 
Posted: 08 August 2008 02:06 PM   [ Ignore ]   [ # 166 ]  
Grad Student
Avatar
Rank
Total Posts:  54
Joined  08-26-2005

This looks very promising for an application I have coming up, but is there no way to set the entry date/time and expiry date/time using values from a CSV file? That would be so nifty!

Profile
 
 
Posted: 08 August 2008 06:38 PM   [ Ignore ]   [ # 167 ]  
Grad Student
Rank
Total Posts:  67
Joined  10-18-2002

This looks very promising for an application I have coming up, but is there no way to set the entry date/time and expiry date/time using values from a CSV file?

I have a patched version that does entry and expiration date/time, and a few other minor fixes. With Andrew’s permission I will post it here, or be happy to give it back to him for merging.

Dan

Profile
 
 
Posted: 11 August 2008 01:47 PM   [ Ignore ]   [ # 168 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  866
Joined  04-14-2007

I am having absolutely no luck with getting the plugin to Grab my data.

Maybe someone will catch something I’m missing. My csv file has been uploaded.

My Grab template looks like:

{exp:csvgrab url="http://www.jrwildkits.com/import_data/2006_FW_b_roster.csv"
    
delimiter=","
    
weblog="3"
    
author_id="1"
    
title="1"
    
category_group="2"
    
category_field="3"
    
use="4|5|6|7|8|9|10"
    
fields="number|first_name|last_name|age|grade|weight|position"
    
unique="title"
}
{
/exp:csvgrab}


I’ve tried both a full path to the csv file as well as a relative path with no success.

Yes, my weblog exists as well as the category group and its categories.

If I’m correct I don’t need the site_id parameter because this site is not part of an MSM install.

Any pointers would be much appreciated.

Thanks

(ah…I’ve also uploaded the xcel file that has created the csv doc, maybe I’ve missed something there???)

File Attachments
2006_FW_b_roster.xls  (File Size: 21KB - Downloads: 36)
 Signature 

Michael Rubens | hothousegraphix
Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that’s creativity. - Charles Mingus

Profile
 
 
Posted: 11 August 2008 02:25 PM   [ Ignore ]   [ # 169 ]  
Grad Student
Rank
Total Posts:  67
Joined  10-18-2002

Michael (hothousegraphix):

Try adding

encloser="QUOTE"

to your attributes. CSV’s produced by Excel don’t have them unless necessary. But fgetcsv(), as used by CSVGrab, may fail if that parameter is not specified.

Also add

trace="true"

to get some additional useful output.

Profile
 
 
Posted: 11 August 2008 02:37 PM   [ Ignore ]   [ # 170 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  12390
Joined  04-29-2002

Your first line has the name of the fields in it, so you need to either get rid of it, or tell CSVGrab to ignore that first row.

There is no encloser in your example, so use “” instead.

I just imported 1200 entries over the weekend to a client site using CSVGrab. It does work. smile I’d add site_id = 1 as well. It might not be required, but if you use this a more of a howto for the next time you need to use it, you’ll remember to have site_id in a MSM setting.

 Signature 

Quick Reference - EE Trial Options - EE Wiki - Docs for updating a build

Profile
MSG
 
 
Posted: 11 August 2008 04:21 PM   [ Ignore ]   [ # 171 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  866
Joined  04-14-2007

Dan, Sue, thanks for the suggestions, I now have it working and everything seems ok.

 Signature 

Michael Rubens | hothousegraphix
Making the simple complicated is commonplace; making the complicated simple, awesomely simple, that’s creativity. - Charles Mingus

Profile
 
 
Posted: 18 August 2008 11:56 AM   [ Ignore ]   [ # 172 ]  
Grad Student
Rank
Total Posts:  69
Joined  12-14-2007

Hi

Quick Question before I carry on with project, Can you use this for multiple csv files??? if not can someone point me in the right direction where I can upload excel workbook sheets.

Cheers in advance

L

EDIT

Help as soon as I posted this csv went mad and i keep getting this error:

Notice: Undefined index: id in /home/sites/directfleetsolutions.co.uk/public_html/office/plugins/pi.csvgrab.php on line 331

Notice: Undefined index: id in /home/sites/directfleetsolutions.co.uk/public_html/office/plugins/pi.csvgrab.php on line 332

Notice: Undefined index: format in /home/sites/directfleetsolutions.co.uk/public_html/office/plugins/pi.csvgrab.php on line 332
MySQL ERROR:

Error Number: 1054

WHAT HAVE I DONE???????

END EDIT

Profile
 
 
Posted: 18 August 2008 05:22 PM   [ Ignore ]   [ # 173 ]  
Grad Student
Rank
Total Posts:  31
Joined  09-17-2007

Just been using this to import a product data file from an affiliate network and it’s pretty handy!

2 things I’d like to see (i.e. be prepared to pay for)

1) Put a default value into a field. The site I’m working on draws in data from multiple source files and a field which indicates the source is needed, but not contained in the input files without some pre-processing.
Maybe a quote-bound value in the ‘use’ parameter rather than pulling a field from the CSV?

2) Add in data into a relationship field
Not trivial I know, but would be incredibly for migrating relational databases into EE.
My site has a weblog ‘brands’ created entirely manually, I’m importing data files of products into a ‘products’ weblog which have a ‘brands’ relationship field which link the two together. Being able to import the brand name into the relationship field in the products weblog would be very useful indeed.

If there’s another route to achieving (2), maybe by importing a value into a text field and then some sort of bulk update….?

Profile
 
 
Posted: 19 August 2008 12:38 PM   [ Ignore ]   [ # 174 ]  
Grad Student
Rank
Total Posts:  69
Joined  12-14-2007

Hi

I have started again with the plugin and have followed the docs to a T but I am not outputting anything?

I have put a trace in and nothing is happening.

Can someone help!!!

Here is my code

{exp:csvgrab url="http://79.170.40.176/directfleetsolutions.co.uk/testy.txt"
    
trace=anything
delimiter
="TAB"
    
encloser="QUOTE"
    
site_id="2"
    
weblog="2"
    
category_group="3"
    
title="1"
    
category_field="6"
    
use="2|3|4|5|7|8|9|10|11"
    
fields="der|otr|dealer|dis|fund|intro|bus24|bus36|per24|per36"
    
unique="der


}

i have also just tried url=“testy.txt” as this rectified the problem I was having before, this time though it is not working.

Can someone advise….any help appreciated

Cheers

L

Profile
 
 
Posted: 20 August 2008 04:16 AM   [ Ignore ]   [ # 175 ]  
Grad Student
Rank
Total Posts:  43
Joined  09-06-2004

I struggled a little with this to. I think there is a problem with the Plugin on servers with Php 5. I made a similar installation with EE 1.6.4 one to different servers, one with PHP Version 5.1.6 and one with PHP Version 4.3.9, and with the old version it works.

Profile
 
 
Posted: 26 August 2008 07:26 PM   [ Ignore ]   [ # 176 ]  
Lab Assistant
Avatar
RankRank
Total Posts:  133
Joined  01-25-2004
jejuna - 04 July 2008 03:10 PM

If Andrew (or someone) would modify the plugin or make a similar one called something like “CSVUpdate” so it COULD be used for updates, I would be jumping for joy.

I second this request… would be very useful to update rather than duplicate entries.  Any chance of this happening?

If not, is there another route to importing/updating multiple weblog entries? Kinda surprising EE doesn’t handle .csv import natively.

Profile
 
 
Posted: 31 August 2008 11:27 AM   [ Ignore ]   [ # 177 ]  
Grad Student
Rank
Total Posts:  31
Joined  09-17-2007

I think there might be a bug relating o the unique parameter, but could be that I’ve misunderstood how it works.

here’s my template:

{exp:csvgrab url="http://mycomain.com/mycsv.csv"
    
weblog="2"
    
title="10"
    
skip="1"
    
delimiter="TAB"
    
encloser="QUOTE"
    
use="11|21|22|32|2"
    
unique="title"
    
fields="productBody|productLargeImage|productLink|productPrice|productMerchant"
}

If I run this twice I end up with 2 lots of data in the weblog

If I add an extra value to the unique parameter e.g..

unique="title,productMerchant"


...then it dedupes OK.

I agree that an option to update would be excellent, part of this job is a price comparison section that regularly updates the file. My only other option is to delete the weblog in the admin area and re-run the whole lot every time.

Andrew, could you add that to the quote you gave me? If I’m going to do this I’d rather do it all at once.

Profile
 
 
Posted: 06 September 2008 11:27 AM   [ Ignore ]   [ # 178 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  428
Joined  11-12-2003

Is it possible to use csvgrab to update existing entries?

 Signature 

version 1.6.4
Build:  20080829

Profile
 
 
Posted: 08 September 2008 10:36 PM   [ Ignore ]   [ # 179 ]  
Summer Student
Total Posts:  3
Joined  09-05-2008
Dan Halbert - 08 August 2008 06:38 PM

This looks very promising for an application I have coming up, but is there no way to set the entry date/time and expiry date/time using values from a CSV file?

I have a patched version that does entry and expiration date/time, and a few other minor fixes. With Andrew’s permission I will post it here, or be happy to give it back to him for merging.

Dan

Dan, did you ever work it out with Andrew to allow publishing your code addition here, the one that allows the import of entry and expiry dates (with or without times)? :D :D

It doesn’t seem to be in the code for the latest version of the CSVGrab plugin. Thanks,

Rob

Profile
 
 
Posted: 09 September 2008 05:29 AM   [ Ignore ]   [ # 180 ]  
Grad Student
Rank
Total Posts:  67
Joined  10-18-2002
424contemplator - 08 September 2008 10:36 PM

Dan, did you ever work it out with Andrew to allow publishing your code addition here, the one that allows the import of entry and expiry dates (with or without times)? :D :D

No, I haven’t gotten a response. I also sent a message via the contact box on Andrew’s website, but didn’t hear from him. There is no copyright notice on the code, but neither is there explicit permission to modify and distribute, so I am a bit reluctant.

Profile
 
 
   
10 of 14
10
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64938 Total Logged-in Users: 57
Total Topics: 81909 Total Anonymous Users: 44
Total Replies: 440309 Total Guests: 299
Total Posts: 522218    
Members ( View Memberlist )