Is there any way to change value of a particular cell in a csv file in java?

I have gone through other questions regarding this on StackOverflow but libraries mentioned there only allow to read or write. Some of them do allow partial read or write like SuperCSV but no library can be used for updating value of a particular cell. Is there some other library that can be used or do I need to do it manually?

Answers


Read in the CSV, modify the cell you want, then write it back to the file.


No, there is no way to directly update the cell in CSV file. You can read CSV line by line and then column by column , update the cell (content) and write to a new file.

And if you know the pattern(regex) then you can use String.replace() method.


Need Your Help

value slice is not a member of play.api.libs.iteratee.Enumerator

scala cassandra-2.0 phantom-dsl

I am writing code based on "Asynchronous iterators for large record sets" described at https://github.com/websudos/phantom#partial-select-queries