/
481.txt
123 lines (84 loc) · 4.97 KB
/
481.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
[12] [DFN[[[CSV]]]] は、[[行]]の区切りに[[改行]]、
[[行]]内の[[列]]の区切りに [CODE[[[,]]]] を使った[[テキストファイル]]で[[表]]を表す[[データ形式]]です。
[17] 単純で古くから広く使われていた形式なので、実装ごとに様々なバリエーションがあります。
現在に至るまで広く共通して採用されている[[仕様]]は存在していません。
* 仕様書
[1] [[CSV]] の書式が [DFN[[[RFC 4180]]]] [SRC[>>24]] になりました。
[REFS[
- [24] [CITE@en[RFC 4180 - Common Format and MIME Type for Comma-Separated Values (CSV) Files]] ([TIME[2016-01-08 20:01:55 +09:00]] 版) <http://tools.ietf.org/html/rfc4180>
- [16] [CITE@en[RFC 7111 - URI Fragment Identifiers for the text/csv Media Type]]
([TIME[2014-01-27 23:43:58 +09:00]] 版)
<http://tools.ietf.org/html/rfc7111>
]REFS]
[22] しかしいくつかある [[CSV]] のバリエーションの一つでしかなく、
世の中の [[CSV]] のすべてをカバーすることを目的にしたものでは無さそうで、
実際カバーできていません。
* TSV との関係
[18] [CODE[[[,]]]] のかわりに [[TAB]] を使った [[TSV]] もよく使われています。
それ以外の記号が使われることもあります。これらも広義の [[CSV]]
として扱われることもしばしばあります。
* バリエーション
[7] [[Excel]] は UTF-8 CSV 読めない。 UTF-16LE BOM つきなら読める。ただし明示的に , 区切りと指定しないと認識しない。
* MIME型
[21] [[媒体型]]名は [CODE(MIME)@en[[[text/csv]]]] です。
** 引数
[2]
,[CODE(MIME)@en[[[charset]]]] ,[[IETF]] [[charset]] ,[CODE(charset)@en[[[US-ASCII]]]] ,[[charset]] ,[[IETF]] [[情報提供]] ,[[RFC 4180]]
,[CODE(MIME)@en[[[header]]]] ,[CODE(MIME)@en[[[present]]]] / [CODE(MIME)@en[[[absent]]]] ,(自動) ,[[見出し行]]の有無 ,[[IETF]] [[情報提供]] ,[[RFC 4180]]
* 素片識別子
[25] [[素片識別子]]は [DFN[RFC 7111]]]] [SRC[>>16]] で規定されています。
[26] ほとんど使われておらず、実装もあまりありません。
* 関連
[23] たまに [[CVS]] と綴りが似ていて混乱します。
* 歴史
** 素片識別子
[REFS[
- [13] [CITE@en[draft-hausenblas-csv-fragment-00 - URI Fragment Identifiers for the text/csv Media Type]]
([TIME[2011-08-08 08:53:47 +09:00]] 版)
<http://tools.ietf.org/html/draft-hausenblas-csv-fragment-00>
- [14] [CITE@en[draft-hausenblas-csv-fragment-03 - URI Fragment Identifiers for the text/csv Media Type]]
( ([TIME[2013-05-05 00:12:07 +09:00]] 版))
<http://tools.ietf.org/html/draft-hausenblas-csv-fragment-03>
- [15] <https://github.com/dret/I-D/tree/master/csv-fragment>
]REFS]
* メモ
[3] [CITE@ja[Comma-Separated Values - Wikipedia]]
( ([TIME[2012-08-06 00:45:41 +09:00]] 版))
<http://ja.wikipedia.org/wiki/Comma-Separated_Values>
[4] [CITE[CSV on the Web Working Group Wiki]]
( ([TIME[2013-12-11 18:59:22 +09:00]] 版))
<http://www.w3.org/2013/csvw/wiki/Main_Page>
[5] [CITE@en-US[CSV on the Web Working Group Charter]]
( ([TIME[2013-12-11 17:31:51 +09:00]] 版))
<http://www.w3.org/2013/05/lcsv-charter>
[6] [CITE[XForms 2.0 - W3C XForms Group Wiki (Public)]]
( ([TIME[2013-12-13 00:30:35 +09:00]] 版))
<http://www.w3.org/MarkUp/Forms/wiki/XForms_2.0#External_CSV_values>
[8] [CITE@en[Model for Tabular Data and Metadata on the Web]]
( ([TIME[2014-03-22 14:38:26 +09:00]] 版))
<http://www.w3.org/TR/2014/WD-tabular-data-model-20140327/>
[9] [CITE[mhausenblas/addrable]]
( ([TIME[2014-04-24 23:35:59 +09:00]] 版))
<https://github.com/mhausenblas/addrable>
[10] [CITE[SPARQL 1.1 Query Results CSV and TSV Formats]]
( ([TIME[2013-03-21 20:27:53 +09:00]] 版))
<http://www.w3.org/TR/2013/REC-sparql11-results-csv-tsv-20130321/#general-comments>
[11] [CITE@en[CSV on the Web: Use Cases and Requirements]]
( ([TIME[2014-06-27 17:08:23 +09:00]] 版))
<http://www.w3.org/TR/2014/WD-csvw-ucr-20140701/>
[FIG(quote)[
[FIGCAPTION[
[19] [CITE@en[Model for Tabular Data and Metadata on the Web]]
([TIME[2015-12-03 19:28:42 +09:00]] 版)
<http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/>
]FIGCAPTION]
> This definition of CSV used in this document is based on IETF's '''['''RFC4180''']''' which is an Informational RFC. The working group's expectation is that future suggestions to refine RFC 4180 will be relayed to the IETF (e.g. around encoding and line endings) and contribute to its discussions about moving CSV to the Standards track.
]FIG]
[FIG(quote)[
[FIGCAPTION[
[20] [CITE@en[Model for Tabular Data and Metadata on the Web]]
([TIME[2015-12-03 19:28:42 +09:00]] 版)
<http://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#h-parsing>
]FIGCAPTION]
> This section describes an algorithm for parsing formats that do not adhere to the constraints described in section 7. Best Practice CSV, as well as those that do, and extracting embedded metadata.
]FIG]