El siguiente código es el que tengo actualmente, sin embargo sobrescribe cualquier dato en el archivo csv en ese momento, en lugar de anexarlo al final. ¿Hay una forma fácil de hacer esto?Anexando a la última línea del archivo CSV en Java
public void printCustomerList() throws IOException{
FileWriter pw = new FileWriter("F:\\data.csv");
Iterator s = customerIterator();
if (s.hasNext()==false){
System.out.println("Empty");
}
while(s.hasNext()){
Customer current = (Customer) s.next();
System.out.println(current.toString()+"\n");
pw.append(current.getName());
pw.append(",");
pw.append(current.getAddress());
pw.append("\n");
}
pw.flush();
pw.close();
}
Posible duplicado de http://stackoverflow.com/questions/6027764/how-to-append-data-to-a-file. –