开发者

merge data into csv with c#

开发者 https://www.devze.com 2023-02-02 08:59 出处:网络
I have a scenario where data is read from a database and written to a csv file. The data has 3 columns Name, Date and Price.If the csv doesn\'t exist, a new file is created and the dat开发者_JAVA技巧a

I have a scenario where data is read from a database and written to a csv file. The data has 3 columns Name, Date and Price.If the csv doesn't exist, a new file is created and the dat开发者_JAVA技巧a is written. If the csv does exist, I have to insert the data relative to the Date data already in the csv. How can I go about doing this?


Easiest way is to parse your csv back in a datastructure, append the data from the database and sort on the date. Then overwrite the file with the sorted data.

0

精彩评论

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