[要約] RFC 4180は、コンマ区切り値(CSV)ファイルの共通フォーマットとMIMEタイプに関する仕様を定義しています。この文書では、CSVファイルの構造、フィールドの扱い、エンコーディングについての基準を提供し、"text/csv"というMIMEタイプを割り当てています。CSVファイルはデータの交換、データベースのインポート/エクスポート、表形式のデータの保存に広く利用されます。

Network Working Group                                    Y. Shafranovich
Request for Comments: 4180                SolidMatrix Technologies, Inc.
Category: Informational                                     October 2005
        

Common Format and MIME Type for Comma-Separated Values (CSV) Files

Comma区切り値(CSV)ファイルの形式とMIMEタイプ

Status of This Memo

本文書の位置付け

This memo provides information for the Internet community. It does not specify an Internet standard of any kind. Distribution of this memo is unlimited.

このメモは、インターネットコミュニティに情報を提供します。いかなる種類のインターネット標準を指定しません。このメモの配布は無制限です。

Copyright Notice

著作権表示

Copyright (C) The Internet Society (2005).

Copyright(c)The Internet Society(2005)。

Abstract

概要

This RFC documents the format used for Comma-Separated Values (CSV) files and registers the associated MIME type "text/csv".

このRFCは、カンマ区切り値(CSV)ファイルに使用される形式を文書化し、関連するMIMEタイプ「text/csv」を登録します。

Table of Contents

目次

   1. Introduction ....................................................2
   2. Definition of the CSV Format ....................................2
   3. MIME Type Registration of text/csv ..............................4
   4. IANA Considerations .............................................5
   5. Security Considerations .........................................5
   6. Acknowledgments .................................................6
   7. References ......................................................6
      7.1. Normative References .......................................6
      7.2. Informative References .....................................6
        
1. Introduction
1. はじめに

The comma separated values format (CSV) has been used for exchanging and converting data between various spreadsheet programs for quite some time. Surprisingly, while this format is very common, it has never been formally documented. Additionally, while the IANA MIME registration tree includes a registration for "text/tab-separated-values" type, no MIME types have ever been registered with IANA for CSV. At the same time, various programs and operating systems have begun to use different MIME types for this format. This RFC documents the format of comma separated values (CSV) files and formally registers the "text/csv" MIME type for CSV in accordance with RFC 2048 [1].

コンマ区切り値形式(CSV)は、かなり長い間、さまざまなスプレッドシートプログラム間でデータを交換および変換するために使用されてきました。驚くべきことに、この形式は非常に一般的ですが、正式に文書化されたことはありません。さらに、IANA MIME登録ツリーには「テキスト/タブ分離値」タイプの登録が含まれていますが、CSVのIANAに登録されたMIMEタイプはありません。同時に、さまざまなプログラムとオペレーティングシステムがこの形式に異なるMIMEタイプを使用し始めています。このRFCは、コンマ分離値(CSV)ファイルの形式を文書化し、RFC 2048 [1]に従ってCSVの「テキスト/CSV」MIMEタイプを正式に登録します。

2. Definition of the CSV Format
2. CSV形式の定義

While there are various specifications and implementations for the CSV format (for ex. [4], [5], [6] and [7]), there is no formal specification in existence, which allows for a wide variety of interpretations of CSV files. This section documents the format that seems to be followed by most implementations:

CSV形式にはさまざまな仕様と実装がありますが(Ex。[4]、[5]、[6]、[7])、CSVのさまざまな解釈を可能にする正式な仕様はありません。ファイル。このセクションでは、ほとんどの実装が続くと思われる形式を文書化します。

1. Each record is located on a separate line, delimited by a line break (CRLF). For example:

1. 各レコードは、ラインブレイク(CRLF)で区切られた別のラインにあります。例えば:

       aaa,bbb,ccc CRLF
       zzz,yyy,xxx CRLF
        

2. The last record in the file may or may not have an ending line break. For example:

2. ファイルの最後のレコードには、終了回線が切れている場合とない場合があります。例えば:

       aaa,bbb,ccc CRLF
       zzz,yyy,xxx
        

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 should contain the same number of fields as the records in the rest of the file (the presence or absence of the header line should be indicated via the optional "header" parameter of this MIME type). For example:

3. 通常のレコードラインと同じ形式のファイルの最初の行として表示されるオプションのヘッダーラインが表示される可能性があります。このヘッダーには、ファイル内のフィールドに対応する名前が含まれており、ファイルの残りのレコードと同じ数のフィールドを含める必要があります(ヘッダーラインの存在または不在は、これのオプションの「ヘッダー」パラメーターを介して示す必要があります。mimeタイプ)。例えば:

       field_name,field_name,field_name CRLF
       aaa,bbb,ccc CRLF
       zzz,yyy,xxx CRLF
        

4. Within the header and each record, there may be one or more fields, separated by commas. Each line should contain the same number of fields throughout the file. Spaces are considered part of a field and should not be ignored. The last field in the record must not be followed by a comma. For example:

4. ヘッダーと各レコード内には、コンマで区切られた1つ以上のフィールドがある場合があります。各行は、ファイル全体に同じ数のフィールドを含める必要があります。スペースはフィールドの一部と見なされ、無視してはいけません。レコードの最後のフィールドには、コンマが続いてはなりません。例えば:

       aaa,bbb,ccc
        

5. Each field may or may not be enclosed in double quotes (however some programs, such as Microsoft Excel, do not use double quotes at all). If fields are not enclosed with double quotes, then double quotes may not appear inside the fields. For example:

5. 各フィールドは、二重引用符で囲まれている場合と囲まれている場合とそうでない場合があります(ただし、Microsoft Excelなどの一部のプログラムは、二重引用符をまったく使用していません)。フィールドが二重引用符で囲まれていない場合、フィールド内に二重引用符が表示されない場合があります。例えば:

       "aaa","bbb","ccc" CRLF
       zzz,yyy,xxx
        

6. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes. For example:

6. ラインブレーク(CRLF)、二重引用符、およびコンマを含むフィールドは、二重引用符で囲む必要があります。例えば:

       "aaa","b CRLF
       bb","ccc" CRLF
       zzz,yyy,xxx
        

7. If double-quotes are used to enclose fields, then a double-quote appearing inside a field must be escaped by preceding it with another double quote. For example:

7. ダブルクォートを使用してフィールドを囲むために、フィールド内に表示されるダブルクォートを別の二重引用で逃れる必要があります。例えば:

       "aaa","b""bb","ccc"
        

The ABNF grammar [2] appears as follows:

ABNF文法[2]は次のように表示されます。

   file = [header CRLF] record *(CRLF record) [CRLF]
        
   header = name *(COMMA name)
        
   record = field *(COMMA field)
        
   name = field
        
   field = (escaped / non-escaped)
        
   escaped = DQUOTE *(TEXTDATA / COMMA / CR / LF / 2DQUOTE) DQUOTE
        
   non-escaped = *TEXTDATA
        
   COMMA = %x2C
        
   CR = %x0D ;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]
        
   CRLF = CR LF ;as per section 6.1 of RFC 2234 [2]
        
   TEXTDATA =  %x20-21 / %x23-2B / %x2D-7E
        
3. MIME Type Registration of text/csv
3. text/csvのMIMEタイプ登録

This section provides the media-type registration application (as per RFC 2048 [1].

このセクションでは、メディアタイプの登録アプリケーションを提供します(RFC 2048 [1]に従って。

To: ietf-types@iana.org

宛先:ietf-types@iana.org

Subject: Registration of MIME media type text/csv

件名:Mime Media Type Text/CSVの登録

MIME media type name: text

MIMEメディアタイプ名:テキスト

MIME subtype name: csv

MIMEサブタイプ名:CSV

Required parameters: none

必要なパラメーター:なし

Optional parameters: charset, header

オプションのパラメーター:チャーセット、ヘッダー

Common usage of CSV is US-ASCII, but other character sets defined by IANA for the "text" tree may be used in conjunction with the "charset" parameter.

CSVの一般的な使用法はUS-ASCIIですが、「テキスト」ツリーのIANAによって定義された他の文字セットは、「charset」パラメーターと組み合わせて使用できます。

The "header" parameter indicates the presence or absence of the header line. Valid values are "present" or "absent". Implementors choosing not to use this parameter must make their own decisions as to whether the header line is present or absent.

「ヘッダー」パラメーターは、ヘッダーラインの有無を示します。有効な値は「存在」または「欠席」です。このパラメーターを使用しないことを選択する実装者は、ヘッダーラインが存在するか欠席しているかについて独自の決定を下す必要があります。

Encoding considerations:

考慮事項のエンコード:

As per section 4.1.1. of RFC 2046 [3], this media type uses CRLF to denote line breaks. However, implementors should be aware that some implementations may use other values.

セクション4.1.1に従って。RFC 2046 [3]の場合、このメディアタイプはCRLFを使用してラインブレークを示します。ただし、実装者は、一部の実装では他の値を使用できることに注意する必要があります。

Security considerations:

セキュリティ上の考慮事項:

CSV files contain passive text data that should not pose any risks. However, it is possible in theory that malicious binary data may be included in order to exploit potential buffer overruns in the program processing CSV data. Additionally, private data may be shared via this format (which of course applies to any text data).

CSVファイルには、リスクをもたらさないパッシブテキストデータが含まれています。ただし、理論的には、プログラム処理CSVデータの潜在的なバッファーオーバーランを活用するために、悪意のあるバイナリデータが含まれる可能性があります。さらに、プライベートデータはこの形式を介して共有される場合があります(もちろん、これは任意のテキストデータに適用されます)。

Interoperability considerations:

相互運用性の考慮事項:

Due to lack of a single specification, there are considerable differences among implementations. Implementors should "be conservative in what you do, be liberal in what you accept from others" (RFC 793 [8]) when processing CSV files. An attempt at a common definition can be found in Section 2.

単一の仕様がないため、実装にはかなりの違いがあります。実装者は、CSVファイルを処理する際に、「あなたがしていることで保守的であり、他の人から受け入れているもので自由になる」(RFC 793 [8])必要があります。一般的な定義の試みは、セクション2に記載されています。

Implementations deciding not to use the optional "header" parameter must make their own decision as to whether the header is absent or present.

オプションの「ヘッダー」パラメーターを使用しないことを決定する実装は、ヘッダーが存在しないか存在するかについて独自の決定を下す必要があります。

Published specification:

公開された仕様:

While numerous private specifications exist for various programs and systems, there is no single "master" specification for this format. An attempt at a common definition can be found in Section 2.

さまざまなプログラムやシステムには多数のプライベート仕様が存在しますが、この形式には単一の「マスター」仕様はありません。一般的な定義の試みは、セクション2に記載されています。

Applications that use this media type:

このメディアタイプを使用するアプリケーション:

Spreadsheet programs and various data conversion utilities

スプレッドシートプログラムとさまざまなデータ変換ユーティリティ

Additional information:

追加情報:

Magic number(s): none

マジックナンバー:なし

File extension(s): CSV

ファイル拡張子:CSV

Macintosh File Type Code(s): TEXT

Macintoshファイルタイプコード:テキスト

Person & email address to contact for further information:

詳細については、連絡先への個人およびメールアドレス:

      Yakov Shafranovich <ietf@shaftek.org>
        

Intended usage: COMMON

意図された使用法:共通

Author/Change controller: IESG

著者/変更コントローラー:IESG

4. IANA Considerations
4. IANAの考慮事項

The IANA has registered the MIME type "text/csv" using the application provided in Section 3 of this document.

IANAは、このドキュメントのセクション3に記載されているアプリケーションを使用して、MIMEタイプ「Text/CSV」を登録しています。

5. Security Considerations
5. セキュリティに関する考慮事項

See discussion above in section 3.

セクション3の上記の説明を参照してください。

6. Acknowledgments
6. 謝辞

The author would like to thank Dave Crocker, Martin Duerst, Joel M. Halpern, Clyde Ingram, Graham Klyne, Bruce Lilly, Chris Lilley, and members of the IESG for their helpful suggestions. A special word of thanks goes to Dave for helping with the ABNF grammar.

著者は、Dave Crocker、Martin Duerst、Joel M. Halpern、Clyde Ingram、Graham Klyne、Bruce Lilly、Chris Lilley、およびIESGのメンバーに有益な提案に感謝します。ABNFの文法を手伝ってくれたデイブに感謝します。

The author would also like to thank Henrik Lefkowetz, Marshall Rose, and the folks at xml.resource.org for providing many of the tools used for preparing RFCs and Internet drafts.

著者はまた、RFCとインターネットドラフトの準備に使用される多くのツールを提供してくれたXML.Resource.orgのHenrik Lefkowetz、Marshall Rose、およびXml.Resource.orgの人々に感謝したいと思います。

A special thank you goes to L.T.S.

特別なありがとうをL.T.S.へ

7. References
7. 参考文献
7.1. Normative References
7.1. 引用文献

[1] Freed, N., Klensin, J., and J. Postel, "Multipurpose Internet Mail Extensions (MIME) Part Four: Registration Procedures", BCP 13, RFC 2048, November 1996.

[1] Freed, N., Klensin, J., およびJ. Postel, 「多目的インターネットメール拡張機能(MIME)パート4:登録手順」, BCP 13, RFC 2048, 1996年11月.

[2] Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.

[2] Crocker, D.およびP. Overell, 「構文仕様のためのBNFの増強:ABNF」, RFC 2234, 1997年11月.

[3] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, November 1996.

[3] Freed, N.およびN. Borenstein, 「多目的インターネットメール拡張機能(MIME)パート2:メディアタイプ」, RFC 2046, 1996年11月.

7.2. Informative References
7.2. 参考引用

[4] Repici, J., "HOW-TO: The Comma Separated Value (CSV) File Format", 2004, <http://www.creativyst.com/Doc/Articles/CSV/CSV01.htm>.

[4] Repici, J., 「ハウツー:コンマ分離値(CSV)ファイル形式」, 2004, <http://www.creativyst.com/doc/articles/csv/csv01.htm>.

[5] Edoceo, Inc., "CSV Standard File Format", 2004, <http://www.edoceo.com/utilis/csv-file-format.php>.

[5] Edoceo, Inc., 「CSV Standard File Format」, 2004, <http://www.edoceo.com/utilis/csv-file-format.php>.

[6] Rodger, R. and O. Shanaghy, "Documentation for Ricebridge CSV Manager", February 2005, <http://www.ricebridge.com/products/csvman/reference.htm>.

[6] Rodger, R.and O. Shanaghy, 「ライスブリッジCSVマネージャーのドキュメント」, 2005年2月, <http://www.ricebridge.com/products/csvman/reference.htm>.

[7] Raymond, E., "The Art of Unix Programming, Chapter 5", September 2003, <http://www.catb.org/~esr/writings/taoup/html/ch05s02.html>.

[7] Raymond, E., 「The Art of Unixプログラミング, 第5章」, 2003年9月, <http://www.catb.org/~esr/writings/taoup/html/ch05s02.html>.

[8] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, September 1981.

[8] Postel, J., 「トランスミッションコントロールプロトコル」, STD 7, RFC 793, 1981年9月.

Author's Address

著者の連絡先

Yakov Shafranovich SolidMatrix Technologies, Inc.

Yakov Shafranovich SolidMatrix Technologies、Inc。

   EMail: ietf@shaftek.org
   URI:   http://www.shaftek.org
        

Full Copyright Statement

完全な著作権声明

Copyright (C) The Internet Society (2005).

Copyright(c)The Internet Society(2005)。

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

この文書は、BCP 78に含まれる権利、ライセンス、および制限の対象となり、そこに記載されている場合を除き、著者はすべての権利を保持しています。

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

このドキュメントとここに含まれる情報は、「現状のまま」に基づいて提供されています。また、貢献者、彼/彼女が代表する組織(もしあれば)が後援する組織、インターネット協会とインターネット工学タスクフォースは、すべての保証、明示的または明示的、またはすべての保証を否認します。本書の情報の使用が、商品性または特定の目的に対する適合性の権利または黙示的な保証を侵害しないという保証を含むがこれらに限定されないことを含む。

Intellectual Property

知的財産

The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.

IETFは、知的財産権またはその他の権利の有効性または範囲に関して、本書に記載されている技術の実装または使用、またはそのような権利に基づくライセンスに基づくライセンスの範囲に関連すると主張される可能性のある他の権利に関しては、立場を取得しません。利用可能になります。また、そのような権利を特定するために独立した努力をしたことも表明していません。RFCドキュメントの権利に関する手順に関する情報は、BCP 78およびBCP 79に記載されています。

Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.

IETF事務局に行われたIPR開示のコピーと、利用可能にするライセンスの保証、またはこの仕様の実装者またはユーザーによるそのような独自の権利の使用のための一般的なライセンスまたは許可を取得しようとする試みの結果を取得できます。http://www.ietf.org/iprのIETFオンラインIPRリポジトリから。

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.

IETFは、関心のある当事者に、著作権、特許、または特許出願、またはこの基準を実装するために必要な技術をカバーする可能性のあるその他の独自の権利を注意深く招待するよう招待しています。ietf-ipr@ietf.orgのIETFへの情報をお問い合わせください。

Acknowledgement

謝辞

Funding for the RFC Editor function is currently provided by the Internet Society.

RFCエディター機能の資金は現在、インターネット協会によって提供されています。