Media Type "text/csv" - trailing nullcols

Tak Tang Tak.Tang at suht.swest.nhs.uk
Thu Mar 24 12:30:43 CET 2005


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




D I S C L A I M E R
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. Any views or opinions presented are solely those of
the author and do not necessarily represent those of the 
Trust unless explicitly stated otherwise.  If you have received this 
e-mail in error please delete the e-mail and contact the
Southampton University Hospitals NHS Trust Helpdesk on:-
023 80796000

The information contained in this e-mail may be subject to public 
disclosure under the Freedom of Information Act 2000. Unless the 
Information is legally exempt from disclosure, the confidentiality
of this e-mail and your reply cannot be guaranteed.

This footnote also confirms that this email message has been swept 
by MIMEsweeper for the presence of computer viruses.




More information about the Ietf-types mailing list