Saving Arduino output to a text file in append mode
There are a couple of ways to append to a text file.

You can either read the entire file in a temporary variable, then append the new data to it and then write to file.

you can implement using printWriter instead like mentioned here:
https://processing.org/discourse/beta/num_1267767630.html


Let me know if it works.