Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对 Super CSV 并不陌生。只是想检查是否有删除或修改 CSV 文件中的一行的规定?
查看源代码,我看不到 RandomAccessFile 在 rw 模式下的使用。有什么方法可以定制这个吗?
Super CSV 不支持编辑 CSV 文件。
快速而肮脏的解决方案是创建 CSV 文件的副本(即使用 Super CSV 读取每一行,然后将其写入不同的文件)。您可以很容易地选择是修改数据还是省略一行。
正如您可能已经看到的,Super CSV 与 Readers/Writers 一起使用。可以编写自己的 Reader/Writer 来包装 RandomAccessFile,然后 Super CSV 可以使用它,但制作副本可能更简单。