One change I have had to make which may be useful to others, is that the duplicate title checking was a problem for me as I’m importing a huge list of businesses, some of which do have the same name. As a result the standard behaviour of the plugin was ignoring 6 out of the 7 businesses named ‘7 Eleven’ for instance. To disable this just change the following on around line 148:To:if ($query->num_rows == 0) {
if ($query->num_rows == 0 or $query->num_rows > 0) {
This was very helpful to me, thanks so much for posting it.
Gah - actually, I’m having a heck of a time! No matter what, I get 4 entries (I have 867). Here’s my file. I’ve tried both a url and a server path.
{exp:csvgrab url="/pathtomyfile/storelist_Jul07.csv"
weblog="9"
title="1"
skip="2"
delimiter=","
encloser=""
use="2|3|5"
fields="store_street_address|store_city|store_zip" }
I need to put them in categories also, but pulled that out of the code to simplify and troubleshoot. This is the output:
Checking: rora Found: rora Checking: S BOOKS & MUS Found: S BOOKS & MUS Checking: Hwy Found: Hwy Checking: S Found: S New entries: 4
I’ve made the above mentioned edit to the plugin, undone it and re-done it and I get the same results. Thanks for any help!
Can I use CSV grab to import a DATE and have it update the standard EE date value?
I tried this:
{exp:csvgrab url=”URL” weblog=”4” title=”9” delimiter=”TAB” encloser=”” use=”1|2|5|6” fields=”var1|date|var2|var3” }
And in the db I’m importing, the date format is:
2007-08-07
When I tried the above code, it just set all of my dates to dec 31, 1969….
Hello there,
first of all: I must say CSVGrab is a great tool and I’m very happy I found it. I’ve got it working in my app and it imported hundreds and thausands of entries for me.
But there are two tiny problems I’m wondering about if you or anyone in here could help me out with this:
1.) I import data with special characters, for example “München” - In my backend I use UTF-8 for character encoding. If I browse through my backend these characters are displayed like this: “M?nchen” - and this gets me confused because I’m not sure if the data was not imported correctly or if the data was just not displayed correctly due to character spezification. If I switch to ISO-8859-1 in my backend installation, all characters are displayed correctly. That’s fine but then I’ll get other problems. Anyway….
:question: [b]Which encoding does SCVGrab use for the import of the data?[/b] Can you specify that
in any way? Can I change that - for expamle - [b]to UTF-8 ??[/b]
2.) CSVGrab provides you from the import of dublicate data because it checks first, if there exists an entry with the same title. This is great but not for me.
I have a property consultant data base running on my installation. Consultants
can be located in different towns, that means, that the names of the consultants
(= title) will remain the same, but the category (= town) will differ.
:question: What do I have to do to filter only dublicate content, [b]if the title AND the
category are the same[/b]???
Thanks for any help you can provide.
If you want to take a look on the page I’m talking about go to:
http://www.weko-immobilien.com
It is a multilingual page with content in german, english and frensh. You can switch to a different language using the language navigation on top right of the page.
Thank you again and good night. :blank:
And while we’re requesting new features, I’d like to be able to establish relationships.
If relationships were a simple matter of putting and entry_id into a field, it would be a no-brainer. But since EE manages relationships in a separate table, CSVGrab would need to be able to take an entry_id from a specified CSV field and use that to create a proper relationship in the relationships table.
P
Before i try this out — if I import a csv file with 300 rows of data and 10 columns(headings) into my Products weblog will i end up with 300 entries that i can edit via the CP? That is will I be able to go and update a particular entry or Publish a new entry via the CP? And will the ten columns headings populate my 10 custom fields which have the same name … (Custom Field is called Busi_name and my CSV column heading is Busi_name)
Hope this is what happens but want to confirm. 😉
Yes, but it’s not an automatic match-up.
You have to use the plug-in’s parameters to tell the plug-in what to do with the data.
For example, the “use=” parameter tells the plug-in which columns from the CSV should be used to populate your custom fields. The “fields=” parameter tells the plug-in which custom fields to put the data into. The “title=” parameter tells the plug-in which column should be used as the {title} of the entry.
There are a host of parameters that all work together to accomplish the desired result. Most of them are covered in the documentation for the plug-in. The plug-in docs can be accessed from the Plug-in Manager page after the plug-in is installed.
I found that the first attempt required a little trial and error, but what you will end up with is 300 new entries in the weblog of your choice which can be edited just like any other weblog entries.
Hope this helps.
how does one run it?? I placed only the following into an empty tempalte caled IMPORT:
{exp:csvgrab url="http://www.mydomain.com/products.csv"
weblog="12"
title="1"
skip="1"
delimiter="TAB"
encloser=""
use="2|5|4|12|3"
fields="prod_description|prod_price|prod_url|prod_imageurl|prod_keywords" }
But notthing happens…. My debugging page says i am missing a closing tag? If i add {exp:csvgrab} it doesn’t complain about a missing tag, but still nothing happens.
(0.102338) Tag: {exp:csvgrab url="http://www.mydomain.com/files/Sample.csv"Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â weblog="12"Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â title="1" skip="2' Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â delimiter="TAB" Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â encloser="QUOTE" Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â use="2|3|4|5|6|7|8|9|10|12|13|14|15" Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â fields="first_name|last_name|address|city||member_number"Â Â }
(0.103503) No Closing Tag
still trying — but I have not been able to add a csv file into my weblog.
1) I created a template called import in my Template Group - Membership
2) i saved my xls spreadsheet as a comma delimited file ssfv.csv and loaded into my files dir
4) here is the file (it only has two records for testing purposes):
TITLE;LAST NAME;FIRST NAME;ADDRESS;CITY;PROV.;AREA CODE;TELEPHONE;CELL PHONE;FAX;E-MAIL ADDRESS;MEMBER;MEMBERNUM;EXPIRY DATE;EXPIRY DATE2
SFV mem;fsdergel;Mattdw;848 Fender St.;Vadfee;WA;09281;345 655-44563;;;matt@gianft.com;FALSE;CA1000000022;31-03-2006; 06/03
;Adews;Micdad;171 dn d Farm;New Land;BC;V4K 1C9;555 537-1989;;;info@madfarm.com;TRUE;CA0001053349 & CA0001053350;30-06-2007; 07/06
3) I added ONLY the following to the import template:
{exp:csvgrab url="http://www.mydomain.com/files/ssfv.csv"
weblog="12"
title="1"
skip="2"
delimiter=";"
encloser="QUOTE"
use="2|3|4|5|6|7|8|9|10|11|12|13|14|15"
fields="first_name|last_name|address|city|prst|area_code|tel|cell|fax|email_address|office|member_status|member_number|expiry_date|expiry_dateMY"}
( I tried both delimiter=”;” and delimiter=”,” as i noticed the csv uses” ;” )
4) and then i do a VIEW RENDERED TEMPLATE while i have the import template open in my CP
5) the template is rendered but nothing gets loaded.
any clues as how to fix??
I’ve added this here - I hope you’ll keep that updated if you get this added to the plugins site, etc. Great tool, thank you. =)
lisa - there is no mention of the CSV Grab utility / plugin to which you link to….
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.