CSV到XML的转换,如何处理文本分隔符 [英] CSV to XML conversion, how to handle text delimeters

查看:134
本文介绍了CSV到XML的转换,如何处理文本分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许是错误的地方,如果有更好的地方,请告诉我。

Maybe the wrong place to ask, if there's a better place, please let me know.

我是尝试将CS​​V文件转换为XML文件。 CSV的结构:

I am trying to convert a CSV file to an XML file. Structure of CSV :

456,"This is,me","Howdy",有时没有逗号

456, "This is, me", "Howdy", sometimes no comma

这应该转换为:


-
< ROOT >
- <ROOT>

推荐答案

XSLT是将XML文档转换为其他TXT格式的语言(http://en.wikipedia.org/wiki/XSLT )。因此,使用XSLT转换CSV是个坏主意。您需要一些CSV解析器,例如:
http://kbcsv.codeplex.com/
XSLT is language for transformation of XML documents into other TXT formats (http://en.wikipedia.org/wiki/XSLT). Therefore it is bad idea to transform CSV using XSLT. You need some CSV parser, e.g.: http://kbcsv.codeplex.com/

这篇关于CSV到XML的转换,如何处理文本分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆