如何使用asp.net c#将新列添加到现有csv文件 [英] how can I add a new column to an existing csv file using asp.net c#

查看:72
本文介绍了如何使用asp.net c#将新列添加到现有csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

存在一个现有的csv文件,其中包含很少的列和相应的行。必须添加包含新生成的唯一ID(从SQL Server中提取)的新列作为最后一列。



我使用了String builder的AppendAllText方法。但它不会在最后添加列,而是将新列及其内容添加到现有数据下面。



请帮我这个。

谢谢。

There is an existing csv file, with few columns and corresponding rows. a new column containing newly generated unique IDs(pulled from SQL Server) have to be added as the last column.

I used AppendAllText method of String builder. But it wont append the column at the end instead it will add the new column and its contents below the existing data.

Please help me with this.
Thank you.

推荐答案

看看你是否在这个链接上有答案



< a href =http://forums.asp.net/t/1979251.aspx?Add+new+column+in+existing+CSV+file+using+C+> http://forums.asp.net/t /1979251.aspx?Add+new+column+in+existing+CSV+file+using+C+ [ ^ ]



或者您可以使用代码项目文章



C#CSV阅读器和作者 [ ^ ]
See whether You have the answer on this link

http://forums.asp.net/t/1979251.aspx?Add+new+column+in+existing+CSV+file+using+C+[^]

Or you can use code project article

C# CSV Reader and Writer[^]


这篇关于如何使用asp.net c#将新列添加到现有csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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