我有一个包含 24 列的 csv 文件。其中我只想阅读 3 列。我看到 super CSV 是一个非常强大的库,但我不知道如何部分读取 CSV。 partial reading上的链接坏了。
请帮我举一个工作示例。
最佳答案
更新:SourceForge 重新上线了! Super CSV 站点现在应该可以工作了:)
这是正确的链接,但 SourceForge 项目网站现在已关闭(根据 SourceForge blog ):
Starting at 12:59 UTC today, we experienced a site outage, causing general connectivity issues sitewide. At 15:12 UTC, site connectivity was restored and most services, including downloads, are now back online. Some services are however are offline while we continue to diagnose and determine the root cause for this issue. The services still offline are:
Project web (ie., projectname.sourceforge.net pages) and associated shell and database services. This also includes access through sftp, scp, and rsync via ssh.
所以你有几个选择:
查看 source code SourceForge 上的阅读示例(SF 的这一部分仍在工作)。左上角有下载文件的链接。
从 subversion 查看项目源(您可以查看/运行上面列出的阅读示例以了解它是如何工作的,或者您甚至可以运行
mvn site:site
来生成项目本地网站查看 cached page来自谷歌
希望您喜欢使用 Super CSV - 如果您有任何其他问题,请随时在 SO 或 project help forum 上发布在 SourceForge 上。
关于csv - 如何使用 Super CSV 部分读取 CSV 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13038635/