开发者

Carriage return line feed causing operation to fail

开发者 https://www.devze.com 2023-03-03 07:29 出处:网络
I am using the ConvertCsvToXML tool in my client application to send data to a webservice. The seperator field is a comma however the last column in csv file is causing a problem.

I am using the ConvertCsvToXML tool in my client application to send data to a webservice. The seperator field is a comma however the last column in csv file is causing a problem.

The name exists with a carriage return line feed in it, how do I avoid this?

The line feed is - "
"

which after research I believe means a new line.

I tried adding it into the seperator fields -

XDocument doc = ConvertCsvToXML(csv, new[] { ",", "
" });

However this does not work, perhaps it doesn开发者_JAVA技巧't allow multiple seperators however I do not know the parameters of the tool.

Any help is much appreciated.


Assuming http://www.codeproject.com/KB/linq/ConvertCsvToXml.aspx (*why do we have to google that?)

XDocument doc = ConvertCsvToXML(csv, new[] { ",", "\n" });

Perhaps you need \r as well

0

精彩评论

暂无评论...
验证码 换一张
取 消