<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>Media Type &quot;text/csv&quot;: new draft (-02) and Last Call</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2 FACE="Arial">In section &quot;2.Definition of the CSV format&quot;, items 3 &amp; 4 state:</FONT>
</P>

<P><FONT FACE="Times New Roman">3. There maybe an optional header line appearing as the first line of the file with the same format as normal record lines. This header will contain names corresponding to the fields in the file and will usually contain the same number of fields as the records in the rest of the file. For example:<BR>
<BR>
field_name,field_name,field_name CRLF<BR>
aaa,bbb,ccc CRLF<BR>
zzz,yyy,xxx CRLF </FONT>
<BR><FONT FACE="Times New Roman">4. Within the header and each record there may be one or more fields, delimited by commas. The last field in the record may or may not be followed by a comma. For example:<BR>
<BR>
aaa,bbb,ccc </FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Why would you permit the last field in the record to be followed by a comma?</FONT>
<BR><FONT SIZE=2 FACE="Arial">If a CSV record comprises:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">aaa,,ccc,ddd,,CRLF</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">does it have 6 fields or 5?</FONT>
<BR><FONT SIZE=2 FACE="Arial">If comma is a field separator only, there are 6 fields:</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">1. aaa</FONT>
<BR><FONT SIZE=2 FACE="Arial">2. &lt;null&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">3. ccc</FONT>
<BR><FONT SIZE=2 FACE="Arial">4. ddd</FONT>
<BR><FONT SIZE=2 FACE="Arial">5. &lt;null&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">6. &lt;null&gt;</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">But if the comma is also a mandatory terminator for the last field (effectively the record separator becomes comma-CRLF), then there are 5 fields.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">In my view, permitting the last field to end with comma leads to ambiguity, and prevents an application from checking that an exact number of fields is present.&nbsp; The only way to guarantee the exact number of fields is then to count the fields in the header.&nbsp; But then your item 3 allows the header record to be omitted.</FONT></P>

<P><FONT SIZE=2 FACE="Arial">Would it not be safer to make the header record mandatory?</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">Thank-you and regards,</FONT>
<BR><FONT SIZE=2 FACE="Arial">Clyde Ingram</FONT>
</P>

</BODY>
</HTML>