C#中的CSV到TXT转换器DLL [英] CSV to TXT Converter DLL in C#

查看:171
本文介绍了C#中的CSV到TXT转换器DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要读取一个CSV文件,剥离定界符并保存一个扩展名为.TXT的新文件.

问题已改善.


Rick

I need to read a CSV file, strip the delimiters and save a new file with the extension .TXT

Question improved.


Rick

推荐答案

一种方法是将文件读取为字符串,然后解析该字符串以用制表符替换逗号,除非逗号在一对单引号内或双引号.
当逗号用作小数点分隔符时,您还必须处理.因此,有一个提示:现在编写一些代码,当您遇到特定问题或遇到异常时,您会提出一个问题.
One way is to read the file into a string and then parse the string to replace commas with a tab character except when the comma is inside a pair of single or double quotes.
You will also have to handle when a comma is used as a decimal separator. So, there''s a hint: now write some code and, when you get stuck on a specific issue or get an exception, then you ask a question.


这篇关于C#中的CSV到TXT转换器DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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