Greetings,
I’m at the beginning of setting up a CSVgrab and have a question about how to best setup my CSV file.
My data is coming from an MS Access database; I’ll export the data I need to CSV. The data is a listing of medical service providers, and each record can belong to anywhere from 1 to 32 different categories. In the Access database, I have the categories setup as 32 separate “true/false” fields.
It seems to me that for the CSVgrab to provide the categories for each record, I need to have all the categories in one field, delimited by a space – is that right?
Or is it possible to retain the 32 separate fields and tell CSVgrab to use each of those fields?
It’s a little unclear to me, and any advice would be appreciated!
strudel
Hi,
I just thought I would post my experience here in using the csvgrab.
My primary intention was to get the csvgrab to import and setup a large category group list for me. It worked well !!! 😊
One major hiccup I had which is worth nothing is that I was working offline while developing my site, and this made the csvgrab useless, so you will need to turn your System to ‘On’ online to get the csvgrab process to work.
And another finickity thing that caused me problems, believe it or not, was the curly quotes used within the {exp:csvgrab} parameters. I was copying directly from the plugin documentation within my EE Control Panel, and I noticed (after almost screaming) that the curly quotes were different when I cut and paste from various sources, so please make sure that you physically type the curly quotes, or make sure they are consistent within the {exp:csvgrab} tags and parameters.
Basically then, I followed Andrew Weaver’s csvgrab plugin instruction on setting up a ‘dummy weblog’ etc with custom_fields and my ultimate desired Category Group.
I then set up an excel / csv file with 4 columns and only one Row Entry.
So in the first column cell, I placed all my categories separated by a ‘comma’. This is the crucial part here. You don’t put the categories in individual rows or cells. Put them all in one cell as the csvgrab process then reads all the categories associated with this one entry.
In the second column cell I placed a dummy title
In the third column cell I placed my dummy custom_field entry
In the fourth column cell I placed my dummy custom_field entry
I then followed Andrew Weaver’s instructions in setting up the ‘go’ template AND basically it worked well by inserting one entry and then inserting all the categories in my Category Group.
You just need to be thinking clearly on whether your categories have spaces within one category name, and then the delimiters you use. Note here below that I used the semi-colon as the csv column delimiter and then the comma as the actual category delimiter which defined my individual categories.
{exp:csvgrab url="http://www.website.com/mycsvfile.csv"
delimiter=";"
encloser="QUOTE"
weblog="13"
category_group="19"
category_field="1"
category_delimiter=","
title="2"
use="3|4"
fields="custom_field|custom_field"
}
Hope this helps someone else who has struggled with the notion of having to hand-type hundreds of categories. 😊
Thank you Andrew for producing a brilliant plugin.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.