Media Type "text/csv" - trailing nullcols

Tak, Thanks for your comments. My intent with this draft was to document the current convention and register the MIME type. I would rather stay away from requiring or allowing features explicetly that might not be followed by all implementations. Yakov Yakov Shafranovich wrote:
From: "Tak Tang" <Tak.Tang@suht.swest.nhs.uk> To: <ietf-types@alvestrand.no> Date: Thu, 24 Mar 2005 11:30:43 +0000 Subj: Media Type "text/csv" - trailing nullcols
Hello,
This is my first post, and I've entered the discussion late, so please excuse me if this has already been discussed . . .
The draft (03) does not require that each record/line have the same number of values/commas. I think it may be benefitial to explicitly allow csv writers to omit trailing commas if there are no further non-null values.
eg (all of these lines are valid) aaa,bbb,ccc,ddd<CR-LF> aaa,,,<CR-LF> aaa<CR-LF> ,bbb<CR-LF> ,,ccc<CR-LF> ,,,ddd<CR-LF>
The second and third line are the same - they just have a value in the first field. The csv reader should assume that if there are missing columns (ie commas) then the values are null. Leading null values still require the commas to be included (lines 4-6).
This is useful when a) the dataset is sparse. b) the dataset has new columns added - the reader can still accept old datafiles without them being considered 'malformed'.
Microsoft Excel and Oracle SQL*Loader can already accept data with missing (trailing) commas.
Tak Tang
participants (1)
-
Yakov Shafranovich