How to open a .txt file that I created using createWriter() at any time??

edited April 2016 in How To...

I created a .txt file using createWriter(). And I have been trying to open the .txt file that this output generates using launch(). The problem with this is that using launch() I must close the output with output.close() so I wont be able to write in the .txt file again and in my program I have information that I need to save coming constantly. So How can I open my .txt file at any time??


  • PrintWriter output; void setup() { output = createWriter("historial_alarmas.txt"); }

    void draw() {

    output.print("HELLO") delay(1000); if(mausePressed){

    output.flush(); output.close(); launch(path); } }

    Here I made something so you can have an idea of what I have in my main code(wich is too long that is why I made this example). in this example The .txt is printed with the word "HELLO" every second. if I pressed the mouse the file will open but the word wont be printed again. I need to do something to open the .txt whenever I want and still saving data on it.. PLEASE HELP!!!

  • why dont you use saveString method ?


  • blyk I tried with it but I does not work for me because I have to print complete sentences in my real code and that function prints each word of the sentence in the next line of the .txt

Sign In or Register to comment.