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. ...
随机推荐
- 题目一:给出一个n,代表有从1到n的数字[1,2,3,··· n],问可以构成多少种二叉搜索树?
题目一:给出一个n,代表有从1到n的数字[1,2,3,··· n],问可以构成多少种二叉搜索树? 一开始的想法是直接递归构造,时间复杂度是指数上升:后来想法是找规律:先看例子: n = 1, 有一个元 ...
- 使用sqlmap执行SQL注入攻击
sqlmap是开源的SQL注入自动攻击工具,它可以自动的探测SQL注入点并且进一步控制网站的数据库. Kali Linux默认安装了这个工具. 找到潜在的攻击目标 第一步是找到有SQL注入漏洞的网站. ...
- python web开发配置
安装python(最好是2.*版本) 安装easyinstall 参考Windows 下 Python easy_install 的安装 完成之后注意环境变量的配置 在系统环境变量的PATH中添加ea ...
- 剑指offer—第二章算法之快速排序
算法:排序和查找(二分查找,归并排序,快速排序),位运算等. 查找:顺序查找,哈希查找,二叉排序树查找,哈希表. 二分查找可以解决:"旋转数组中的最小数字","数字在排序 ...
- 洛谷 P3015 [USACO11FEB]最好的括号Best Parenthesis
传送门 题目大意:给出括号的得分标准. ()得分为1,如果A的得分为S(A),那么 (A)的得分为2*S(A). 题解:搜索 #include<iostream> #include< ...
- innerHTML和innerText怎么区分
示例代码:<div id="test"> <span style="color:red">test1</span> test ...
- ①SpringCloud前序知识-CAP原则
本文主要介绍SpringCloud里头一些常见的原理.定理等相关SpringCloud的技术知识 一.CAP原则 CAP原则又称CAP定理,指的是在一个分布式系统中,Consistency(一致性). ...
- POI 单元格
OI 单元格合并中的CellRangeAddress 参数: CellRangeAddress(int, int, int, int) 参数:起始行号,终止行号, 起始列号,终止列号 sheet.ad ...
- vs2005中microsoft ado data control 6.0控件问题
在vs2005中是没有这个控件的,需要注册,步骤如下: 1. 先到C:\WINDOWS\system32目录下看看你的系统里是否已经有了MSADODC.ocx和MSDATGRD.ocx这两个文件(多半 ...
- elasticsearch pinyin 拼音分词器
安装pinyin分词 地址:https://github.com/medcl/elasticsearch-analysis-pinyin PUT py_test { "index" ...