How to edit a text file

I have managed to make a simple file writing program which can append to a file. Now, I want to know how to edit an already existing text file. I want to be able to access a specific line or something and then change or append stuff onto that line. How do you do these kinds of things? Here is my code:
import java.io.FileWriter; import java.io.BufferedWriter; void setup() { size(1, 1); try { FileWriter output = new FileWriter(sketchPath()+"\\strings.txt", true); output.write("stuff"); output.write(System.getProperty( "line.separator" )); output.flush(); output.close(); } catch(IOException e) { println("It broke!!!"); e.printStackTrace(); } exit(); }

Answers

Sign In or Register to comment.