| draft-shafranovich-mime-csv-01.txt | draft-shafranovich-mime-csv-02.txt | |||
|---|---|---|---|---|
| Network Working Group Y. Shafranovich | Network Working Group Y. Shafranovich | |||
| Internet-Draft SolidMatrix Technologies, Inc. | Internet-Draft SolidMatrix Technologies, Inc. | |||
| Expires: August 20, 2005 February 16, 2005 | Expires: August 22, 2005 February 18, 2005 | |||
| Common Format and MIME Type for CSV Files | Common Format and MIME Type for CSV Files | |||
| draft-shafranovich-mime-csv-01.txt | draft-shafranovich-mime-csv-02.txt | |||
| Status of this Memo | Status of this Memo | |||
| This document is an Internet-Draft and is subject to all provisions | This document is an Internet-Draft and is subject to all provisions | |||
| of Section 3 of RFC 3667. By submitting this Internet-Draft, each | of Section 3 of RFC 3667. By submitting this Internet-Draft, each | |||
| author represents that any applicable patent or other IPR claims of | author represents that any applicable patent or other IPR claims of | |||
| which he or she is aware have been or will be disclosed, and any of | which he or she is aware have been or will be disclosed, and any of | |||
| which he or she become aware will be disclosed, in accordance with | which he or she become aware will be disclosed, in accordance with | |||
| RFC 3668. | RFC 3668. | |||
| skipping to change at page 1, line 35 | skipping to change at page 1, line 35 | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| The list of current Internet-Drafts can be accessed at | The list of current Internet-Drafts can be accessed at | |||
| http://www.ietf.org/ietf/1id-abstracts.txt. | http://www.ietf.org/ietf/1id-abstracts.txt. | |||
| The list of Internet-Draft Shadow Directories can be accessed at | The list of Internet-Draft Shadow Directories can be accessed at | |||
| http://www.ietf.org/shadow.html. | http://www.ietf.org/shadow.html. | |||
| This Internet-Draft will expire on August 20, 2005. | This Internet-Draft will expire on August 22, 2005. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (C) The Internet Society (2005). | Copyright (C) The Internet Society (2005). | |||
| Abstract | Abstract | |||
| This document documents the format used for Comma-Separated Values | This document documents the format used for Comma-Separated Values | |||
| (CSV) files and registers the associated MIME type "text/csv". | (CSV) files and registers the associated MIME type "text/csv". | |||
| skipping to change at page 3, line 34 | skipping to change at page 3, line 34 | |||
| exists which causes a wide variety of interpretations for CSV files. | exists which causes a wide variety of interpretations for CSV files. | |||
| This section seeks to document the format that seems to be followed | This section seeks to document the format that seems to be followed | |||
| by most implementations: | by most implementations: | |||
| 1. Each record is located on a separate line delimited by a line | 1. Each record is located on a separate line delimited by a line | |||
| break (CRLF). For example: | break (CRLF). For example: | |||
| aaa,bbb,ccc CRLF | aaa,bbb,ccc CRLF | |||
| zzz,yyy,xxx CRLF | zzz,yyy,xxx CRLF | |||
| 2. The last record in the file may or may not have an ending | 2. The last record in the file may or may not have an ending line | |||
| linebreak. For example: | break. For example: | |||
| aaa,bbb,ccc CRLF | aaa,bbb,ccc CRLF | |||
| zzz,yyy,xxx | zzz,yyy,xxx | |||
| 3. There maybe an optional header line appearing as the first line | 3. There maybe an optional header line appearing as the first line | |||
| of the file with the same format as normal record lines. This | of the file with the same format as normal record lines. This | |||
| header will contain names corresponding to the fields in the file | header will contain names corresponding to the fields in the file | |||
| and will usually contain the same number of fields as the records | and will usually contain the same number of fields as the records | |||
| in the rest of the file. For example: | in the rest of the file. For example: | |||
| skipping to change at page 4, line 22 | skipping to change at page 4, line 22 | |||
| zzz,yyy,xxx | zzz,yyy,xxx | |||
| 6. Field containing line breaks (CRLF) and commas should be enclosed | 6. Field containing line breaks (CRLF) and commas should be enclosed | |||
| in double-quotes. For example: | in double-quotes. For example: | |||
| "aaa","b CRLF | "aaa","b CRLF | |||
| bb","ccc" CRLF | bb","ccc" CRLF | |||
| zzz,yyy,xxx | zzz,yyy,xxx | |||
| 7. If double-quotes are used to enclosed fields, then double-quotes | 7. If double-quotes are used to enclosed fields, then double-quotes | |||
| inside fields must be surounded by double quotes. For example: | inside fields must be surrounded by double quotes. For example: | |||
| "aaa","b"""bb","ccc" | "aaa","b"""bb","ccc" | |||
| The ABNF grammar [1] appears as follows: | The ABNF grammar [1] appears as follows: | |||
| file = [header CRLF] record *(CRLF record) [CRLF] | file = [header CRLF] record *(CRLF record) [CRLF] | |||
| header = name *(COMMA name) | header = name *(COMMA name) | |||
| record = field *(COMMA field) | record = field *(COMMA field) | |||
| skipping to change at page 4, line 46 | skipping to change at page 4, line 46 | |||
| field = (escaped / non-escaped) | field = (escaped / non-escaped) | |||
| escaped = DQUOTE *(VCHAR / CR / LF / CRLF / 3*DQUOTE) DQUOTE | escaped = DQUOTE *(VCHAR / CR / LF / CRLF / 3*DQUOTE) DQUOTE | |||
| non-escaped = *VCHAR | non-escaped = *VCHAR | |||
| COMMA = %x2C | COMMA = %x2C | |||
| CR = %x0D ;as per section 6.1 of RFC 2234 [1] | CR = %x0D ;as per section 6.1 of RFC 2234 [1] | |||
| DQUOTE = %x22;as per section 6.1 of RFC 2234 [1] | ||||
| LF = %x0A ;as per section 6.1 of RFC 2234 [1] | LF = %x0A ;as per section 6.1 of RFC 2234 [1] | |||
| CRLF = CR LF ;as per section 6.1 of RFC 2234 [1] | CRLF = CR LF ;as per section 6.1 of RFC 2234 [1] | |||
| VCAR = %x21-7E ;as per section 6.1 of RFC 2234 [1] | VCHAR = %x21-7E ;as per section 6.1 of RFC 2234 [1] | |||
| 3. MIME Type Registration of text/csv | 3. MIME Type Registration of text/csv | |||
| This section provides the media-type registration application (as per | This section provides the media-type registration application (as per | |||
| RFC 2048 [4], which will be submitted to IANA after IESG approval of | RFC 2048 [4], which will be submitted to IANA after IESG approval of | |||
| this document. | this document. | |||
| To: ietf-types@iana.org | To: ietf-types@iana.org | |||
| Subject: Registration of MIME media type text/csv | Subject: Registration of MIME media type text/csv | |||
| skipping to change at page 6, line 4 | skipping to change at page 6, line 4 | |||
| Due to lack of a single specification there are considerable | Due to lack of a single specification there are considerable | |||
| differences among different implementations. Implementors should | differences among different implementations. Implementors should | |||
| "be conservative in what you do, be liberal in what you accept | "be conservative in what you do, be liberal in what you accept | |||
| from others" (RFC 793 [3]) when processing CSV files. An attempt | from others" (RFC 793 [3]) when processing CSV files. An attempt | |||
| at a common definition can be found in Section 2. | at a common definition can be found in Section 2. | |||
| Published specification: | Published specification: | |||
| While numerous private specifications exist for various programs | While numerous private specifications exist for various programs | |||
| and systems, there is no single "master" specification for this | and systems, there is no single "master" specification for this | |||
| format. An attempt at documentating a common definition can be | format. An attempt at a common definition can be found in | |||
| found in Section 2. | Section 2. | |||
| Applications which use this media type: | Applications which use this media type: | |||
| Spreadsheet programs and various data conversion utilities | Spreadsheet programs and various data conversion utilities | |||
| Additional information: | Additional information: | |||
| Magic number(s): none | Magic number(s): none | |||
| File extension(s): CSV | File extension(s): CSV | |||
| skipping to change at page 8, line 6 | skipping to change at page 8, line 6 | |||
| mailing list <http://www.alvestrand.no/mailman/listinfo/ietf-types/> | mailing list <http://www.alvestrand.no/mailman/listinfo/ietf-types/> | |||
| which is also reachable via <ietf-types@iana.org>. Of course, | which is also reachable via <ietf-types@iana.org>. Of course, | |||
| comments directly to the author are always welcome. | comments directly to the author are always welcome. | |||
| A.2 Document Repository | A.2 Document Repository | |||
| Copies of this and earlier versions including multiple formats can be | Copies of this and earlier versions including multiple formats can be | |||
| found at <http://www.shaftek.org/publications/drafts/mime-csv/>. | found at <http://www.shaftek.org/publications/drafts/mime-csv/>. | |||
| A.3 Document History | A.3 Document History | |||
| Changes from draft-shafranovich-mime-csv-01 to | ||||
| draft-shafranovich-mime-csv-00: | ||||
| o Minor errors in ABNF grammar corrected in response to AD comments | ||||
| o Minor spelling mistakes corrected | ||||
| Changes from draft-shafranovich-mime-csv-00 to | Changes from draft-shafranovich-mime-csv-00 to | |||
| draft-shafranovich-mime-csv-01: | draft-shafranovich-mime-csv-01: | |||
| o Type "text/comma-separated-values" has been removed | o Type "text/comma-separated-values" has been removed | |||
| o The "encoding consideration" paragraph of Section 3 has been | o The "encoding consideration" paragraph of Section 3 has been | |||
| changed to allow CRLF only as per section 4.1.1. of RFC 2046 [2]. | changed to allow CRLF only as per section 4.1.1. of RFC 2046 [2]. | |||
| This has been reflected in the ABNF grammar in Section 2. | This has been reflected in the ABNF grammar in Section 2. | |||
| End of changes. | ||||
This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/ | ||||