draft-shafranovich-mime-csv-04.txt   draft-shafranovich-mime-csv-05.txt 
Network Working Group Y. Shafranovich Network Working Group Y. Shafranovich
Internet-Draft SolidMatrix Technologies, Inc. Internet-Draft SolidMatrix Technologies, Inc.
Expires: October 4, 2005 April 2, 2005 Expires: October 7, 2005 April 5, 2005
Common Format and MIME Type for CSV Files Common Format and MIME Type for CSV Files
draft-shafranovich-mime-csv-04.txt draft-shafranovich-mime-csv-05.txt
Status of this Memo Status of this Memo
This document is an Internet-Draft and is subject to all provisions By submitting this Internet-Draft, each author represents that any
of Section 3 of RFC 3667. By submitting this Internet-Draft, each applicable patent or other IPR claims of which he or she is aware
author represents that any applicable patent or other IPR claims of have been or will be disclosed, and any of which he or she becomes
which he or she is aware have been or will be disclosed, and any of aware will be disclosed, in accordance with Section 6 of BCP 79.
which he or she become aware will be disclosed, in accordance with
RFC 3668.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as other groups may also distribute working documents as Internet-
Internet-Drafts. Drafts.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
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 October 4, 2005. This Internet-Draft will expire on October 7, 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".
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Definition of the CSV format . . . . . . . . . . . . . . . . . 3 2. Definition of the CSV format . . . . . . . . . . . . . . . . . 3
3. MIME Type Registration of text/csv . . . . . . . . . . . . . . 5 3. MIME Type Registration of text/csv . . . . . . . . . . . . . . 5
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 6
5. Security Considerations . . . . . . . . . . . . . . . . . . . 6 5. Security Considerations . . . . . . . . . . . . . . . . . . . 7
6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 7
7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 7. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7
7.1 Normative References . . . . . . . . . . . . . . . . . . . 7 7.1 Normative References . . . . . . . . . . . . . . . . . . . 7
7.2 Informative References . . . . . . . . . . . . . . . . . . 7 7.2 Informative References . . . . . . . . . . . . . . . . . . 7
Author's Address . . . . . . . . . . . . . . . . . . . . . . . 8 Author's Address . . . . . . . . . . . . . . . . . . . . . . . 8
A. Status of This Document [To Be Removed Upon Publication] . . . 8 A. Status of This Document [To Be Removed Upon Publication] . . . 8
A.1 Discussion Venue . . . . . . . . . . . . . . . . . . . . . 8 A.1 Discussion Venue . . . . . . . . . . . . . . . . . . . . . 8
A.2 Document Repository . . . . . . . . . . . . . . . . . . . 8 A.2 Document Repository . . . . . . . . . . . . . . . . . . . 8
A.3 Document History . . . . . . . . . . . . . . . . . . . . . 8 A.3 Document History . . . . . . . . . . . . . . . . . . . . . 8
Intellectual Property and Copyright Statements . . . . . . . . 10 Intellectual Property and Copyright Statements . . . . . . . . 10
1. Introduction 1. Introduction
The comma separated values format (CSV) has been used for exchanging The comma separated values format (CSV) has been used for exchanging
and converting data between various spreadsheet programs for quite and converting data between various spreadsheet programs for quite
some time. Surprisingly, while this format is very common it has some time. Surprisingly, while this format is very common it has
never been formally documented. Additionally, while the IANA MIME never been formally documented. Additionally, while the IANA MIME
registration tree includes a registration for registration tree includes a registration for "text/
"text/tab-separated-values" type, no MIME types have ever been tab-separated-values" type, no MIME types have ever been registered
registered with IANA for CSV. At the same time, various programs and with IANA for CSV. At the same time, various programs and operating
operating systems have begun to use different MIME types for this systems have begun to use different MIME types for this format, many
format, many of which vary from system to system. This document of which vary from system to system. This document seeks to document
seeks to document the format of comma separated values (CSV) files the format of comma separated values (CSV) files and to formally
and to formally register the "text/csv" MIME type for CSV in register the "text/csv" MIME type for CSV in accordance with RFC 2048
accordance with RFC 2048 [1]. [1].
2. Definition of the CSV format 2. Definition of the CSV format
While there are various specifications and implementations for the While there are various specifications and implementations for the
CSV format (for ex. [4], [5], [6] and [7]), no formal specification CSV format (for ex. [4], [5], [6] and [7]), no formal specification
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
skipping to change at page 4, line 43 skipping to change at page 4, line 44
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)
name = field name = field
field = (escaped / non-escaped) field = (escaped / non-escaped)
escaped = DQUOTE *(TEXTDATA / CR / LF / 2*DQUOTE) DQUOTE escaped = DQUOTE *(TEXTDATA / COMMA / CR / LF / 2DQUOTE) DQUOTE
non-escaped = *TEXTDATA non-escaped = *TEXTDATA
COMMA = %x2C COMMA = %x2C
CR = %x0D ;as per section 6.1 of RFC 2234 [2] CR = %x0D ;as per section 6.1 of RFC 2234 [2]
DQUOTE = %x22 ;as per section 6.1 of RFC 2234 [2] DQUOTE = %x22 ;as per section 6.1 of RFC 2234 [2]
LF = %x0A ;as per section 6.1 of RFC 2234 [2] LF = %x0A ;as per section 6.1 of RFC 2234 [2]
CRLF = CR LF ;as per section 6.1 of RFC 2234 [2] CRLF = CR LF ;as per section 6.1 of RFC 2234 [2]
TEXTDATA = %x20-21 / %x23-7E TEXTDATA = %x20-21 / %x23-2B / %x2D-7E
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 [1], which will be submitted to IANA after IESG approval of RFC 2048 [1], 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 7, line 7 skipping to change at page 7, line 11
After IESG approval, IANA is expected to register the MIME type After IESG approval, IANA is expected to register the MIME type
"text/csv" using the application provided in Section 3 of this "text/csv" using the application provided in Section 3 of this
document. document.
5. Security Considerations 5. Security Considerations
See discussion above See discussion above
6. Acknowledgments 6. Acknowledgments
The author would like to thank Dave Crocker, Martin Duerst, Clyde The author would like to thank Dave Crocker, Martin Duerst, Joel M.
Ingram, Graham Klyne, Bruce Lilly, Chris Lilley and members of the Halpern, Clyde Ingram, Graham Klyne, Bruce Lilly, Chris Lilley and
IESG for their helpful suggestions. A special word of thanks to Dave members of the IESG for their helpful suggestions. A special word of
for helping with the ABNF grammar. thanks to Dave for helping with the ABNF grammar.
The author would also like to thank Henrik Lefkowetz, Marshall Rose The author would also like to thank Henrik Lefkowetz, Marshall Rose
and the folks at xml.resource.org for providing many of the tools and the folks at xml.resource.org for providing many of the tools
used for preparing RFCs and Internet drafts. used for preparing RFCs and Internet drafts.
7. References 7. References
7.1 Normative References 7.1 Normative References
[1] Freed, N., Klensin, J. and J. Postel, "Multipurpose Internet [1] Freed, N., Klensin, J., and J. Postel, "Multipurpose Internet
Mail Extensions (MIME) Part Four: Registration Procedures", Mail Extensions (MIME) Part Four: Registration Procedures",
BCP 13, RFC 2048, November 1996. BCP 13, RFC 2048, November 1996.
[2] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax [2] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997. Specifications: ABNF", RFC 2234, November 1997.
[3] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [3] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part Two: Media Types", RFC 2046, November Extensions (MIME) Part Two: Media Types", RFC 2046,
1996. November 1996.
7.2 Informative References 7.2 Informative References
[4] Repici, J., "HOW-TO: The Comma Separated Value (CSV) File [4] Repici, J., "HOW-TO: The Comma Separated Value (CSV) File
Format", 2004, Format", 2004,
<http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm>. <http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm>.
[5] Edoceo, Inc., "CSV Standard File Format", 2004, [5] Edoceo, Inc., "CSV Standard File Format", 2004,
<http://www.edoceo.com/utilis/csv-file-format.php>. <http://www.edoceo.com/utilis/csv-file-format.php>.
[6] Rodger, R. and O. Shanaghy, "Documentation for Ricebridge CSV [6] Rodger, R. and O. Shanaghy, "Documentation for Ricebridge CSV
Manager", February 2005, Manager", February 2005,
<http://www.ricebridge.com/products/csvman/reference.htm>. <http://www.ricebridge.com/products/csvman/reference.htm>.
[7] Raymond, E., "The Art of Unix Programming, Chapter 5", September [7] Raymond, E., "The Art of Unix Programming, Chapter 5",
2003, September 2003,
<http://www.catb.org/~esr/writings/taoup/html/ch05s02.html>. <http://www.catb.org/~esr/writings/taoup/html/ch05s02.html>.
[8] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, [8] Postel, J., "Transmission Control Protocol", STD 7, RFC 793,
September 1981. September 1981.
Author's Address Author's Address
Yakov Shafranovich Yakov Shafranovich
SolidMatrix Technologies, Inc. SolidMatrix Technologies, Inc.
skipping to change at page 8, line 29 skipping to change at page 8, line 30
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-04 to
draft-shafranovich-mime-csv-05:
o Fixes in ABNF grammar: comma excluded from TEXTDATA and added to
escaped text, 2*DQUOTE changed to 2DQUOTE.
Changes from draft-shafranovich-mime-csv-03 to Changes from draft-shafranovich-mime-csv-03 to
draft-shafranovich-mime-csv-04: draft-shafranovich-mime-csv-04:
o Fixed ABNF grammar in response to IESG comments: VCHAR changed to o Fixed ABNF grammar in response to IESG comments: VCHAR changed to
TEXTDATA, DQUOTE excluded from TEXTDATA, spaces are included in TEXTDATA, DQUOTE excluded from TEXTDATA, spaces are included in
TEXTDATA, CRLF taken out since CR and LF are already included. TEXTDATA, CRLF taken out since CR and LF are already included.
o Added clarification that double quotes may not be included inside o Added clarification that double quotes may not be included inside
non-quoted fields. non-quoted fields.
 End of changes. 

This html diff was produced by rfcdiff 1.23, available from http://www.levkowetz.com/ietf/tools/rfcdiff/