NPOI 支持 CSV/TSV?
我将 NPOI 库与 C# 应用程序一起使用。
我正在创建一个报告系统,可以自动读取 Excel 工作表并提取数据。我收到了一份规范,通知我需要在系统中提取的所有报告均为 .xls 格式,但现在情况似乎并非如此。
我想知道是否可以使用 NPOI 库读取 CSV 或 TSV 文件?我已经爬过网络,但似乎只能找到与该库的 Java 版本相关的答案。
任何帮助将不胜感激,谢谢:)
I'm using the NPOI library with a C# application.
What I'm creating is a reporting system that automatically reads, and extracts data from an excel sheet. I was given a spec, informing me that all reports I needed to ingest in my system were in .xls format however now this appears not to be the case.
I'm wondering is it possible to read in a CSV or TSV file using the NPOI library? I've crawled the web but only seem to be able to find answers relating to the Java version of this library.
Any help would be appreciated, thanks :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要读取 .Net 中的 csv 文件,您应该使用以下之一:
To read csv files in .Net you should take one of these:
关于 NPOI 库本身的文档并不多。但是,由于这是来自 Apache POI 库的移植,因此您同样可以查阅那里的文档。此外,还有演示 NPOI 使用的示例代码,可以在 http://npoi.codeplex.com/ 找到releases
关于您的问题:NPOI 不处理 CSV 格式。请参阅:http://www .leniel.net/2009/07/creating-excel-spreadsheets-xls-xlsx-c.html#comment-391471769
There isn't much documentation on the NPOI library itself. However, as this is a port from the Apache POI library, you can equally well consult the documentation there. Also, there is example code demonstrating the use of NPOI, which can be found at http://npoi.codeplex.com/releases
Regarding your question: NPOI doesn't handle the CSV format. See: http://www.leniel.net/2009/07/creating-excel-spreadsheets-xls-xlsx-c.html#comment-391471769