.NET & Tab-Delimited files

笑着哭i 提交于 2020-01-28 11:33:09

问题


How can I create and append to a tab-delimited file in C#?


回答1:


Here's quite a nice (free) utility for working with delimited files in .NET http://www.filehelpers.com/




回答2:


Here is a fast and very easy to use library that allows you to specify the delimiter. It is hosted on CodeProjects. This gives a matrix like access to your delimited file (e.g. a 2 dimensional array).

CsvReader




回答3:


IMHO, tab separated value files are some of the easiest to work with. Some applications (like Excel) will sometimes wrap values in quotes, but for the most part you can read TSV files by splitting rows on the tab character (and possibly checking for the first and last character being a quote). Writing them then, is even simpler - write a tab ("\t") between every field and a newline at the end of the row (or use a command that takes care of the newline for you, like writeline).



来源:https://stackoverflow.com/questions/2888385/net-tab-delimited-files

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!