We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: CSVGrab

Development and Programming

Andrew Weaver's avatar
Andrew Weaver
206 posts
16 years ago
Andrew Weaver's avatar Andrew Weaver

The sequence of the fields should not be a problem. To be honest, I’ve not tried importing into dropdown list fields - I’d expect it to import into the database ok, but there might be problems viewing it in the Control Panel if the value has not been set up as a value in the custom field

       
fanderson's avatar
fanderson
883 posts
16 years ago
fanderson's avatar fanderson

I think I may have figured out the complication here. The music_cd field is actually a related entry field. I wonder if there is any way around that? Otherwise everything uploaded perfectly. What do you think about the related entry field? Any hope?

       
Andrew Weaver's avatar
Andrew Weaver
206 posts
16 years ago
Andrew Weaver's avatar Andrew Weaver

CSVGrab does not currently handle related fields, sorry. It is on my list of things to add to the plugin (but has been there for a long time now).

       
fanderson's avatar
fanderson
883 posts
16 years ago
fanderson's avatar fanderson

Andrew, I am a lot closer than I was before I found your plugin. I’ll check to see if there is a way to bulk edit/modify entries to make it work. Again, thank you very much for your help.

       
Marcus Neto's avatar
Marcus Neto
1,005 posts
16 years ago
Marcus Neto's avatar Marcus Neto

I am having issues with getting it to recognize Author. My csv file is formatted as follows…

dwergs    2002-07-01    00:00:00 AM CEST    MSN Messenger 4.7.0036    <b>MSN Messenger 4.7.0036</b> has been extracted from a service pack beta. If you'd like to have this unofficial release as well as the <b>new polygamy patch</b> for it, pay a visit to <a href="http://mess.localdispute.com/_scripts/track/odtrack.php3?url=http://users.pandora.be/heavyk/" class="noUnderlines" target="_blank" rel="noopener">Heavy K</a>'s.
dwergs    2002-07-04    00:00:00 AM CEST    downloads fixed    Downloads fixed (thanks to all the people who reported this!).
Marcus    2002-07-05    00:00:00 AM CEST    msn mobile    <span class="boldText">MSN Mobile</span><span class="normalText"> now officially launched in <a href="http://www.msn.be/gsm/smsservices/" class="noUnderlines" target="_blank" rel="noopener">Belgium</a> and the <a href="http://www.msn.nl/mobiel/hotmailsms/" class="noUnderlines" target="_blank" rel="noopener">Netherlands</a>.

And my template is formatted as follows…

{exp:csvgrab url="path to file name here"
    delimiter="TAB"
    weblog="3"
    title="4"
    date="2"
    author="1"
    use="5"
    fields="simplecontent"
}

As you can see I am throwing out the time as I don’t really care about it I just want to date. The Date, Title, and Simple Content field are all importing as desired but the Author is not being picked up. I have tried the Author tag and importig using the use tag.

Help! M.

       
russlipton's avatar
russlipton
305 posts
16 years ago
russlipton's avatar russlipton

Any chance of enhancing so that edits can be imported to existing entries?

       
Andrew Weaver's avatar
Andrew Weaver
206 posts
16 years ago
Andrew Weaver's avatar Andrew Weaver
I am having issues with getting it to recognize Author.

Unfortunately, the author parameter does not work like that. The author= parameter just takes a value which is the id of the EE member, it cannot use a value from the CSV file (although it is a sensible thing to try and do - I’ll add it to my to do list)

Andrew

       
Andrew Weaver's avatar
Andrew Weaver
206 posts
16 years ago
Andrew Weaver's avatar Andrew Weaver
Any chance of enhancing so that edits can be imported to existing entries?

I’m hoping to release a version soon that allows entries to be updated.

Andrew

       
Marcus Neto's avatar
Marcus Neto
1,005 posts
16 years ago
Marcus Neto's avatar Marcus Neto

Andrew is it possible to specify author as a custom field in the “use” fields? Or is author just not something that is supported period?

       
Simon Cox's avatar
Simon Cox
405 posts
16 years ago
Simon Cox's avatar Simon Cox

Andrew and Dan - thanks for your great work on this so far - potentially a very useful function. After several hours of testing I have almost got this plug in to update a sites diary system - which will make it much easier for the client to update his site. However the dairy system I have out together in EE includes a custom field for the event date (a simple date field) and this seems to be causing me some problems.

In my spreadsheet I have a list of the event dates - I even formatted them just like Andrews instructions: (YYYY-MM-DD) so my exampe is: 2009-02-06

However when the template is run and the entry is reviewed the date in the custom field is showing the following: 1969-12-31 17:00 - which is a good few years before the date of each event!

Any ideas would be appreciated!

( I am using Dans zip file as it seems to bethe latest version and I also upgraded EE tonight from 1.6.3 to 1.6.6 in the hope that it would shake the tree on this issue - but I still have the problem.)

       
Andrew Weaver's avatar
Andrew Weaver
206 posts
16 years ago
Andrew Weaver's avatar Andrew Weaver

The plugin does not currenlty handle putting dates into custom fields, only into the entry’s entry_date field.

You could try (I have never tried this) opening the CSV file in a spreadsheet and creating an extra column to store the date as a UNIX timestamp (this is how EE stores the date internally), and then import this column into your custom date field.

In Excel, I think the formula to convert from a YYYY-MM-DD format to a UNIX timestamp is: =(A1-DATE(1970,1,1))*86400 where the original YYYY-MM-DD date is stored is the cell A1

This might help…

Andrew

       
Dan Halbert's avatar
Dan Halbert
93 posts
16 years ago
Dan Halbert's avatar Dan Halbert

A caution: Andrew’s idea might work in principle, but the UNIX timestamps that are stored in the database are offset by the server’s local time: they are not standard timestamps. (At the moment, I can’t remember if the offset is subtracted or added). So I think the times will be off by a few hours, unless you offset the time by 3600*timezoneoffset.

       
Simon Cox's avatar
Simon Cox
405 posts
16 years ago
Simon Cox's avatar Simon Cox

It certainly did help Andrew - many thanks!

I am using Dan’s version as it has the expiry date function but I am getting a couple of errors on the ‘go’ page -

Notice: strtotime(): Called with empty time parameter in /home/public_html/system/plugins/pi.csvgrab.php on line 270
Checking: No Friday meeting 28-Nov-2008

Notice: Undefined index: event date in /home/public_html/system/plugins/pi.csvgrab.php on line 612
Found new entry: No Friday meeting 28-Nov-2008

(don’t worry that’s not the real paths to the plug in file!) This might be some hidden white space in the spreadsheet though - will clean it up later.

However - it’s seems to be working just great - the entries are being built and the dates are now all correct for the entry date, event_date (a custom field) and the expiry date My spread sheet already had some function in as I cut and past the diary events from a newsletter and I need to change the title by adding the date to it (found a concatenation formula for Excel to do that).

This is going to save me a ton of time in the future (admittedly I was up to 4am this morning trying to get it to work but in the long run there will be a pay off!)

       
sciexpression's avatar
sciexpression
19 posts
16 years ago
sciexpression's avatar sciexpression

After using the plugin i have now got over 4,000 categories! Help each category seems to be holding seperate data from the import!

Any help would be appreciated!

Thanks

       
Tammo's avatar
Tammo
59 posts
16 years ago
Tammo's avatar Tammo

Hi,

I just tried out the plugin but I can’t get it to work somehow. I must be overlooking something. Nothing happends at all when I run the go template. My code is:

{exp:csvgrab url="http://www.my-domain.com/import.csv"
weblog="3"
title="1"
delimiter=";"
skip="1”
use="2|3"
fields="website|description" }

I also use the feedgrab plugin, same principle, and that works fine. Any help on this would be great!

regards, Tammo

       
First 14 15 16 17 18 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.