Closed danielGz closed 3 years ago
Any fix for this? CsvWriter should provide option for amend and create new file
I will consider this as part of an API overhaul. But for now, you could simply to this to append to a file:
File file = new File("/tmp/foo");
CsvWriter csvWriter = new CsvWriter();
try (CsvAppender append = csvWriter.append(new FileWriter(file, true))) {
append.appendLine("a", "b");
}
Thanks for the reply & the workaround. But, the name method name 'append' is bit confusing. Any plan to work on it? The writer should provide method for creating new file & appending to existing file.
+1 the method name is really confusing could you please rename the append method and provide a proper append method with the workaround you provided on master branch? I guess a lot of API users will lose some time on this.
OutputStreamWriter is always run with WRITE option so the file content gets replaced everytime.