plomino / Plomino

Powerful and flexible web-based application builder
33 stars 37 forks source link

CSV Import - Final column issue #69

Closed glimmung closed 12 years ago

glimmung commented 12 years ago

Hi,

I've been working on a batch of CSV imports, and have found that the final column has not imported. On a hunch, I experimented with terminating the lines with a comma, like so: -

importTimestamp,unitCreditValue,unitGuideLrnHrs,unitLevel,unitMandAssessReq,unitNo,unitOptAssess,unitOptAssessReq,unitQCFUnit,unitTitle, "2012-03-08 00:00:00 GMT","2","30","2","0","ABC123","0","0","True","Underwater Basket Weaving",

...and found that this works.

Is this the intended behaviour?

I'd rather not ask the upstream provider of these files to do something non-standard, and indeed the RFC (http://tools.ietf.org/html/rfc4180) does suggest that "The last field in the record must not be followed by a comma", although I appreciate that there is not a definitive spec for CSV files.

Cheers,

PhilK

jean commented 12 years ago

Plomino just uses the Python csv module: http://docs.python.org/library/csv.html

Do you have a small example that reproduces your issue?

glimmung commented 12 years ago

Hi Jean,

I've been getting inconsistent results with this - I see the error off and on as I develop imports in my production instance, but I'm not able to reproduce it in a clean instance - I'll leave this issue open for now, as I think that there /is/ an issue of some sort, but that it's more subtle than just dropping the final column. I think it's a "gotcha" that is worth noting here, rather than an actual Plomino issue - more when I find it!

PhilK

glimmung commented 12 years ago

Not able to reproduce, so closing!