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

Brainwrek's avatar
Brainwrek
75 posts
17 years ago
Brainwrek's avatar Brainwrek

Hello Andrew.

This looks outstanding! Just one question though… Is there any way to fix this so that we can have multiple categories in the field (eg. 3|4|7|9)? I’ve seen other related questions, but don’t know if your latest release has this functionality yet?

I assume it would involve the use of 2 different delimiters in the CSV though, right? Something like:

TITLE;DATE;AUTHOR;SUMMARY;BODY;3|4|5|6|7;LINK

…where the 3|4|5|6|7 are the categories that the entry is assigned to.

Can this be implemented?

Thank you again!

       
fender21's avatar
fender21
36 posts
17 years ago
fender21's avatar fender21

The current link is http://www.americanaroots.com/content/index2.php?option=com_podcast&feed=RSS2.0&no_html=1

I would update Feedburner, but I have the same issue in that I’m not sure how to force an update to the itunes directory that my new XML link will be feedburner.com/americanaroots. I’ve read that you can add a node to the itunes xml file to state that you have a new location but I was hoping someone around here ran into the same issue and could share their experiences.

       
yassiryahya's avatar
yassiryahya
33 posts
17 years ago
yassiryahya's avatar yassiryahya

Hey guys

Kinda need a fast reply but the I realized now it’s the weekend…

Anyways, was wondering if it’s possible to make the title use a combination of columns. Let’s say I have the csv below :

"Temp","SpCond","Cond","TDS","Salinity","DO%","DO Conc","Depth","pH","Turbidity+"
"C","uS/cm","uS/cm","g/L","ppt","%","mg/L","m","","NTU"

01/12/07 01:01:32,25.820,32.010,33.010,0.021,0.010,87.200,7.101,0.104,6.711,212.900
01/12/07 01:16:32,25.810,32.010,33.010,0.021,0.010,87.000,7.081,0.092,6.711,220.101
01/12/07 01:31:32,25.810,32.010,33.010,0.021,0.010,87.310,7.111,0.082,6.720,226.701
01/12/07 01:46:32,25.800,32.010,33.010,0.021,0.010,87.200,7.101,0.087,6.731,225.701
01/12/07 02:01:32,25.800,32.010,33.010,0.021,0.010,87.400,7.111,0.130,6.740,232.101

Is it possible to use the date and time as title? And how do I seperate them? I’m sure I can’t use delimiter=”COMMA” since there’s a space in between the date and time, right? Will the code below work?

{exp:csvgrab url="http://localhost/0123456.txt"
                          weblog="4"
                          title="4 && 5"
                          skip="3"
                          delimiter="SPACE && COMMA"
                          use="1|2|3|4|5|6|7|8|9|10|11|12"
                          fields="time|date|temp|cond|xx|x|x|x| ...." }
       
Andrew Weaver's avatar
Andrew Weaver
206 posts
17 years ago
Andrew Weaver's avatar Andrew Weaver

Hi,

At the moment, the plugin cannot use combinations of fields or multiple delimiters. I’d suggest loading the CSV file into a spreadsheet app and using that to preprocess into the format you need.

       
sm9's avatar
sm9
352 posts
17 years ago
sm9's avatar sm9

Hi Andrew,

I’ve just used your version 2 plugin (I’d never used the version 1) to import some data into one of the sites I’m using with the Multiple Site Manager. This is just the plugin I’ve been hoping for so can’t believe it took me so long to come across it! 😊

I’ve just imported one record and although it has imported okay, there was one teething bug (or I’m doing something wrong). I’ve just noticed that although I had site_id=”2” in the template, the entry was entered into the exp_weblog_data table as being in site_id 1, though it was correctly entered in exp_weblog_titles as being in site_id 2. Do you have any ideas about how to fix this? I know site_id hasn’t been mentioned in the thread, though I did notice it in the plugin so thought I’d take a shot anyway! 😉

For info, here’s what my template looks like:

{exp:csvgrab url="http://www.mywebsite.co.uk/new_csv_import_1301.csv" 
                          weblog="4"
                          site_id="2"
                          title="2"
                          delimiter="TAB"
                          encloser="QUOTE"
                          category="27"
                          use="4|5|6|7|8|9|10|11|12|13|14"
                          fields="cf_winners_description|cf_winners_telephone|cf_winners_website|cf_winners_contact|cf_winners_latitude|cf_winners_longitude|cf_winners_park_name|cf_winners_organisation_id|cf_winners_organisation_name|cf_winners_region|cf_winners_la_area"}

Thanks,

Ste

       
Martin de Wit's avatar
Martin de Wit
150 posts
17 years ago
Martin de Wit's avatar Martin de Wit

Wow, this is really a great tool! Thanks!

One question. I have an excel sheet that has a lot of line breaks (as in paragraphs) within individual cells. Since line breaks mean new rows, I have to swap them for something else. I tried \r and \n, but that doesn’t work. I could use <br> but I’d rather have clean non-html data in my textfields.

Anyone knows if I can use some other code for a newline?


NEVER MIND

I figured it out already. I have to use quotes as field enclosers.

       
Ace Prod's avatar
Ace Prod
111 posts
17 years ago
Ace Prod's avatar Ace Prod

This is working great (so far for me). I’d just like to add that the link to download this tools here: http://expressionengine.com/wiki/Migrate_To_EE/ doesn’t actually work and should be replaced with the link on page 4 of this thread. Would anybody be kind enough to change it?

Thanks!

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
17 years ago
Ingmar Greil's avatar Ingmar Greil

You know what makes wikis fun? 😊 Anyway, I did it.

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
17 years ago
Sue Crocker's avatar Sue Crocker

Ste, I modified the script to use site_id, but while there isn’t a copyright on the script per se, the fix would be better coming from Andrew.

       
DEA's avatar
DEA
257 posts
17 years ago
DEA's avatar DEA

Question regarding subcategories. Does CSVGrab respect the parent categories setting when importing entries?

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

Sue: I have a new version of CSVGrab (& Feedgrab) that obeys the Multiple Site Manager settings - I’ll hopefully release it very soon once tested.

DEA: it does not respect the parent category setting at the moment, but it is on my to do list…

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
17 years ago
Sue Crocker's avatar Sue Crocker

Thanks for the update on CSVGrab and FeedGrab. I’d be happy to test them for you. 😊

       
Martin de Wit's avatar
Martin de Wit
150 posts
17 years ago
Martin de Wit's avatar Martin de Wit

Hello Andrew,

Thank you for this wonderfull tool which works fabulously 😊

But… I have a tiny problem with some characters (ó,ü,é,etc.). They turn into question marks in the database. But they show correctly as feedback on the page where I run your script.

I did a lot of tests changing the charset of the page I run csvGrab on and also changed settings in EE, but with litte result.

Do you or anyone else have an idea what I should do. This question was posed before in this thread:

Hello there, 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….

BTW: I am using version 0.2

Ad: I just took a look in phpMyAdmin (now why didn’t I so that before). I saw the characters are there but unencoded. So that explains the questionmark. But what can I do about it?

       
Ingmar Greil's avatar
Ingmar Greil
29,243 posts
17 years ago
Ingmar Greil's avatar Ingmar Greil

Yes, you should use utf-8 throughout. Make sure that the actual .csv is in utf-8. This can be tricky, but an advanced editor should let you set it manually.

       
Martin de Wit's avatar
Martin de Wit
150 posts
17 years ago
Martin de Wit's avatar Martin de Wit

Thanks Ingmar. But I actually used dreamweaver which is not a csv editor at all. Exported it from Excel and than searched and replaced a lot of stuff which I couldn’t in Excel.

Can I add some headers into the csv or doesn’t it work like that? I know litte about this stuff.

I also see no way in Excel to save as utf-8.

       
First 5 6 7 8 9 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.