有没有在C#中的任何CSV器/写入库? [英] Are there any CSV readers/writer libraries in C#?

查看:199
本文介绍了有没有在C#中的任何CSV器/写入库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何 CSV 读者/ C#中的作家库?

Are there any CSV readers/writer libraries in C#?

推荐答案

尝试 CsvHelper 。它们也一样容易FastCsvReader使用,并且也没有写入。我一直很高兴在过去FastCsvReader,但我需要的东西,它也书写,并且是不愉快的FileHelpers。

Try CsvHelper. It's as easy to use as FastCsvReader and does writing also. I've been very happy with FastCsvReader in the past, but I needed something that does writing also, and wasn't happy with FileHelpers.

阅读:

var csv = new CsvReader( stream );
var myCustomTypeList = csv.GetRecords<MyCustomType>();

写作:

var csv = new CsvWriter( stream );
csv.WriteRecords( myCustomTypeList );

披露:我是这个库的作者

Full Disclosure: I am the author of this library.

这篇关于有没有在C#中的任何CSV器/写入库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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