Printwrite always overwriting file

63 Views Asked by At

im trying to match phone numbers so i could print them to a .txt file but im having a bit of trouble.

Thank you very much.

1

There are 1 best solutions below

0
On BEST ANSWER

Use append mode:

FileWriter output = new FileWriter("result.txt", true);
PrintWriter write = new PrintWriter(new BufferedWriter(output));