First I just have to say this module totally rocks! Just reporting a small problem with the CSV import. It seems that the import doesn't respect quoted text eg you want to import "5,000". The program currently will break that up into two columns storing 5 and 000.
Not sure if quotes need to be set aside as the way to enclose text (or maybe you select what to use like you would in excel) but this would need to allow your data to have commas, double quotes, single quotes, etc.
Comments
Comment #1
pobster commentedHello!
Sorry wasn't ignoring you (I fixed the NOT NULL issue after you first posted - thanks for spotting that!) the reason I hadn't replied is that I know absolutely nothing at all about CSV... I only implemented it at the request of someone on here and I've never actually used it myself. Anyways, I will update the code if I can - but at present I can't find any coding examples anywhere to suggest the best way to go about handling this function? If you know anything about programming then please help!! :o) I *will* try my best to look into doing it, but as of yet I've not found anything useful... Most examples I've found whilst googling do exactly what I've done in my version (just using commas?) Dunno I'm afraid :o( Need help!
Pobster
Comment #2
pobster commentedComment #3
rbrooks00 commentedI'll see if I can find an example or two but in the meantime what about checking out the user import: http://drupal.org/node/31940 or the node import: http://drupal.org/project/node_import
Both of those projects have been around for a while and I'd assume they probably deal with this scenario but I haven't used them myself.
Comment #4
pobster commentedOkay! Been experimenting... And I've come up with this:
Now the new bit of code starts at // experiment... It currently only supports ONE comma inside of quoted text - so you can import say:
name,age
paul,30
"sheba, dog",9
sally,24
For a table import of the occupants of my house ;o)
Now obviously this isn't ideal as there will be situations where you'll need more than one lot of commas, BUT (!!!!) in doing this it's given me an idea!!! :o) I'm going to attempt to explode each line by " rather than by , - then I should be able to manipulate whats left easier... Note - should be ;o) It's not next on my list of things to do, but given this idea I don't think I'll have any problem doing it.
Pobster
Comment #5
pobster commentedOhhhhh okay :o) I thought it'd be easy so I just went ahead and fixed it ;o)
It *should* work, I tested it a little - but feedback would be very much appreciated.
Thanks
Pobster
Comment #6
pobster commented