CSV Format
【CSV Format】
The comma separated values format (CSV) has been used for exchanging and converting data between various spreadsheet programs for quite some time. 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. Each record is located on a separate line, delimited by a line break (CRLF). For example:
以CRLF来区别每一个record
2. The last record in the file may or may not have an ending line break. For example:
最后一条记录可以不加CRLF
3. There maybe an optional header line appearing as the first lineof 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:
可以添加head,通过optional parameter的header flag来指示
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:
用逗号分隔 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:
可以有也可以没有双引号
6. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes. For example:
如果有CRLF, 双引号,逗号,则这些符号必须放置在双引号中。
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:
使用双引号时,必须前置双引号以escape
参考:http://www.rfc-editor.org/rfc/rfc4180.txt
CSV Format的更多相关文章
- djangoadmin导出csv
from django.contrib import admin from .models import Order,OrderItem from django.http import HttpRes ...
- xls===>csv tables===via python ===> sqlite3.db
I've got some files which can help a little bit to figure out where people are from based on their I ...
- Python操作csv文件
1.什么是csv文件 The so-called CSV (Comma Separated Values) format is the most common import and export fo ...
- django后台admin csv 格式表格导出
1.在app下新建一个.py文件 此例commen.py commen.py (内容)(具体怎么导出的也不知道这么写就对了) import csv from django.http import H ...
- 导出CSV乱码
导出CSV,无论是什么格式,excel打卡都是乱码 需要加上 echo "\xEF\xBB\xBF"; header("Content-Disposition:attac ...
- python 读取mysql数据至csv文件中,并发送邮件
test 代码: #coding:utf-8 ''' Created on 2019年2月18日 @author: Administrator ''' import ConfigParser impo ...
- Jmeter-Maven-Plugin高级应用:Test Results File Format-Test Results
Test Results File Format Test Results Disabling The <testResultsTimestamp> Enabling <append ...
- HTML save data to CSV or excel
/********************************************************************************* * HTML save data ...
- Qt Read and Write Csv File
This page discusses various available options for working with csv documents in your Qt application. ...
随机推荐
- 《Drools7.0.0.Final规则引擎教程》第4章 4.2 agenda-group
agenda-group 规则的调用与执行是通过StatelessKieSession或KieSession来实现的,一般的顺序是创建一个StatelessKieSession或KieSession, ...
- Arcgis for Javascript之featureLayer图和属性的互操作
说明:主要实现加载FeatureLayer与显示属性表,并实现属性表与地图的联动,首先,看看实现后的效果: 显示效果 如上图所示,本文章主要实现了以下几个功能:1.FeatureLayer属性表的分页 ...
- 最新海康摄像机、NVR、流媒体服务器、回放取流RTSP地址规则说明
本文档主要介绍海康威视设备预览.回放.流媒体取流的RTSP URL和IE直接预览.回放的HTTP URL. RTSP为取流协议,取到码流后需要解码显示,可以通过VLC播放器进行测试,IE等浏览器网页不 ...
- ng 自定义服务
服务的本质是对象. 创建服务的常见方式:factory(返回对象) service (方法.属性)constant(常量服务) value(变量服务) 1.factoryapp.factory('服务 ...
- Beego的controller怎么用嵌入实现继承问题
Go Lang是无继承层次的轻量级面向对象编程范式.Go Lang中的接口与实现之间完全是非侵入式的.这种接口实现方式很值得称赞.不但如此,在Go Lang中只有类型嵌入而没有类型继承.这规避了很多与 ...
- 抽象类,接口类,封装,property,classmetod,statimethod
抽象类,接口类,封装,property,classmetod,statimethod(类方法,静态方法) 一丶抽象类和接口类 接口类(不崇尚用) 接口类:是规范子类的一个模板,只要接口类中定义的,就应 ...
- HDU - 6098:Inversion(暴力均摊)
Give an array A, the index starts from 1. Now we want to know B i =max i∤j A j Bi=maxi∤jAj , i≥2 i≥ ...
- 后台导入导出Excel
Excel导出 定义数据模型 参考财付通的批量提现Excel的格式,定义模型如下 private int recordId; //提现id private String cname; //提现人名称 ...
- Python使用教程
1.下载python windows:http://www.python.org/download/ 2.环境变量: 3.pycharm下载:http://www.python.org/downloa ...
- 遇到eclipse安装插件一直报错问题(版本问题)
刚好用了一个插件,然后在线安装报错了,一直报错,之前用的这个插件是直接解压贴的,现在在线安装出错,就很尬,我又有点懒,不想再去下载,贴,所以查了下,有网友说是eclipse的插件版本问题,更新了下,成 ...