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后缀,用文本编辑器就可以打开。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值