您的位置:首页 > 其它

CSV格式文件

2008-11-28 09:18 375 查看
CSV即Comma
Separate Values的缩写,现在常见到这种格式的文件,例如Google
adsense的自定义报表就有这种格式。

The CSV (”Comma Separated Value”) file format is often used to
exchange data between disparate applications. The file format, as
it is used in Microsoft Excel, has become a pseudo standard
throughout the industry, even among non-Microsoft platforms.

As is the case with most exchange formats since XML, CSV files
have become somewhat of a legacy format. New applications that wish
to include an export format will generally use XML today (though
there may be exceptions). In legacy systems though (pre-XML), CSV
files had indeed become a de facto industry standard. Just as there
are still billions of lines of CoBOL code in use today that need to
be maintained, support for a legacy standard such as CSV is likely
to be required long after it has stopped being implemented in new
designs.

具体来说,格式如下:
每条记录占一行
以逗号为分隔符
逗号前后的空格会被忽略
字段中包含有逗号,该字段必须用双引号括起来
字段中包含有换行符,该字段必须用双引号括起来
字段前后包含有空格,该字段必须用双引号括起来
字段中的双引号用两个双引号表示
字段中如果有双引号,该字段必须用双引号括起来
第一条记录,可以是字段名

windows平台下一般将CSV文件定义为xml后缀,用文本编辑器就可以打开。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: