.NET & Tab-Delimited files

前端 未结 3 916
名媛妹妹
名媛妹妹 2020-12-22 08:44

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

3条回答
  •  -上瘾入骨i
    2020-12-22 09:23

    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).

提交回复
热议问题