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的更多相关文章

  1. djangoadmin导出csv

    from django.contrib import admin from .models import Order,OrderItem from django.http import HttpRes ...

  2. 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 ...

  3. Python操作csv文件

    1.什么是csv文件 The so-called CSV (Comma Separated Values) format is the most common import and export fo ...

  4. django后台admin csv 格式表格导出

    1.在app下新建一个.py文件  此例commen.py commen.py (内容)(具体怎么导出的也不知道这么写就对了) import csv from django.http import H ...

  5. 导出CSV乱码

    导出CSV,无论是什么格式,excel打卡都是乱码 需要加上 echo "\xEF\xBB\xBF"; header("Content-Disposition:attac ...

  6. python 读取mysql数据至csv文件中,并发送邮件

    test 代码: #coding:utf-8 ''' Created on 2019年2月18日 @author: Administrator ''' import ConfigParser impo ...

  7. Jmeter-Maven-Plugin高级应用:Test Results File Format-Test Results

    Test Results File Format Test Results Disabling The <testResultsTimestamp> Enabling <append ...

  8. HTML save data to CSV or excel

    /********************************************************************************* * HTML save data ...

  9. Qt Read and Write Csv File

    This page discusses various available options for working with csv documents in your Qt application. ...

随机推荐

  1. js 扩展实例

    //扩展实例1 字符串中首字符转大写 var test=' this is '; String.prototype.mytrim=function(){ var re=/^\s+(.*?)\s+$/; ...

  2. session不一定非得要cookie开启才能使用。也可以使用get传递参数

    session不一定非得要cookie开启才能使用.也可以使用get传递参数 可以将session_id();设置为一个常量. define(’s_id‘ ,$_COOKIE['session_nam ...

  3. "==" 与 "is"的区别

    Is there a difference between `==` and `is` in Python? "=="是比较内容相当;"is"是比较对象的id是 ...

  4. HDU - 6197:array array array (简单LIS)

    One day, Kaitou Kiddo had stolen a priceless diamond ring. But detective Conan blocked Kiddo's path ...

  5. ORACLE PL/SQL编程之触发器

    8.1 触发器类型 8.1.1 DML触发器 8.1.2 替代触发器 8.1.3 系统触发器 8.2 创建触发器 8.2.1 触发器触发次序 8.2.2 创建DML触发器 8.2.3 创建替代(INS ...

  6. QtAV的编译方法

    1--编译准备 QtAV的安装编译总指导说明:https://github.com/wang-bin/QtAV/wiki/Build-QtAV QtAV的源代码:https://github.com/ ...

  7. (转)Android 50道面试题总结(大家看看吧)

    1. 方法重载与覆盖的区别?(Overload与Override的区别)2. String 和StringBuffer的区别3. 字符串“abcde”通过写一个函数不让调用第三方的字符串,实现一个字符 ...

  8. 1020. Tree Traversals (25) ——树的遍历

    //题目 通过后续遍历 中序遍历 得出一棵树 ,然后按树的层次遍历打印 PS:以前对于这种用指针的题目是比较头痛的,现在做了一些链表操作后,感觉也不难 先通过后续中序建一棵树,然后通过BFS遍历这棵树 ...

  9. 参数化防SQL注入

    private void AddStudent(){ string strName =txtName.Text.Trim(); string strPwd = txtPwd.Text.Trim(); ...

  10. composer的安装和使用 学习日志

    如果你做为一个phper,没有用过composer,那你真的不是一个合格的开发者.那么就来记录一下composer的学习日志 下面分享几个学习源头: composer中文网站:https://www. ...