CSV格式 就是 txt文本的-------

"订单编号","买家会员名","买家支付宝账号","买家应付货款","买家应付邮费","买家支付积分","总金额","返点积分","买家实际支付金额","买家实际支付积分","订单状态","买家留言","收货人姓名","收货地址 ","运送方式","联系电话 ","联系手机","订单创建时间","订单付款时间 ","宝贝标题 ","宝贝种类 ","物流单号 ","物流公司","订单备注","宝贝总数量","店铺Id","店铺名称","订单关闭原因","卖家服务费","买家服务费","发票抬头","是否手机订单"
"124525532368168","8090_芭比团","18922178533","396.00","0.00","0","396.00","0","396.00","0","卖家已发货,等待买家确认","","何柯","广东省 广州市 白云区 人和穗和名庭C 403(510000)","卖家承担运费","'020-36049625","'18922178533","2012-03-12 22:42:39","2012-03-12 22:44:50","极速快递单打印软件 批量发货 自动快递派送范围识别 发货提醒","1","","","'买家: 8090_芭比团 张保安 396元 新的共3台 第1台","1","0","","订单未关闭","0","0","",""
"132755917892881","女子东爱","feiyu.211314@163.com","332.20","0.00","0","332.20","0","332.20","0","卖家已发货,等待买家确认","","郑爱东","辽宁省 丹东市 振兴区 富贵山庄B区13号楼0605室(118000)","卖家承担运费","","'15241559288","2012-03-12 22:02:20","2012-03-12 22:05:27","极速快递单打印 客户管理 批量发货后自动发货提醒 客户crm回访","1","","","'买家: 女子东爱 郑爱东 充值短信5千条 340元 106通道的","50","0","","订单未关闭","0","0","",""
"124514691352881","女子东爱","feiyu.211314@163.com","7.80","0.00","0","7.80","0","7.80","0","卖家已发货,等待买家确认","","郑爱东","辽宁省 丹东市 振兴区 辽宁省丹东市振兴区鑫欣家园小区(30号楼)二单元404室(118000)","卖家承担运费","","'13304952800","2012-03-12 21:52:12","2012-03-12 21:53:00","极速快递单打印 客户管理 批量发货后自动发货提醒 客户crm回访","1","","","","1","0","","订单未关闭","0","0","",""


注意它的格式,是用逗号分开 然后用 双引号 扩住的

正好完全符合 TStringList的CommaText属性

看下 官方F1出来的帮助文档  真是详细 还是官方 详细啊

Lists the strings in the TStrings object in system data format (SDF). 

Use CommaText to get or set all the strings in the TStrings object in a single comma-delimited string.

When retrieving CommaText, any string in the list that include spaces, commas or quotes will be contained in double quotes, and any double quotes in a string will be repeated. For example, if the list contains the following strings:

Stri,ng 1
Stri"ng 2
String 3
String4
CommaText will return:

"Stri,ng 1","Stri""ng 2","String 3",String4
When assigning CommaText, the value is parsed as SDF formatted text. For SDF format, strings are separated by commas or spaces, and optionally enclosed in double quotes. Double quote marks that are part of the string are repeated to distinguish them from the quotes that surround the string. Spaces and commas that are not contained within double quote marks are delimiters. Two commas next to each other will indicate an empty string, but spaces that appear next to another delimiter are ignored. For example, suppose CommaText is set to:

"Stri,ng 1", "Stri""ng 2" , String 3,String4
The list will then contain:

Stri,ng 1
Stri"ng 2
String
3
String4
Note: CommaText is the same as the DelimitedText property with a delimiter of ',' and a quote character of '"'.
Including a trailing comma in the source string causes a blank item to be included in the string list. For example, if CommaText is set to

"String1, String 2, String 3,"
the string list will contain

String1
String2
String3
<Blank>



posted on 2012-03-13 11:44  del88  阅读(14)  评论(0编辑  收藏  举报