如何在csv文件中导出单行数据表? [英] How to export single row of datatable in csv file?
本文介绍了如何在csv文件中导出单行数据表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在新的csv文件中导出单行,我想为不同csv文件中的所有行执行此任务。
解决方案
你有没有请看这个例子:将DataTable写入CSV文件 [ ^ ]
只需稍加修改,您就可以从数据表中仅导出所需的行。就个人而言,我做了一个更改并使用DataView而不是DataTable作为WriteDataTable
的参数。这样可以很容易地使用过滤器。
我是c#编程的新手,所以我不能解读你提供的代码的确切逻辑,你可以探索一些简短的代码或逻辑。
I want to export single row in new csv file and i want to do this task for all rows in different csv files.
解决方案
Have you already had a look at this for example: Writing a DataTable to a CSV file[^]
With a little modification you can make it to export only desired rows from a datatable. Personally I'd make a change and use a DataView instead of a DataTable as a parameter toWriteDataTable
. This would make it easy to use a filter.
I'm new to c# programming, so i cant Undersand the exact logic of code you provided, Can u explore some short code or logic.
这篇关于如何在csv文件中导出单行数据表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文