I have a text file that says:
Joan
Paul
Carren
What I would like to do is add Sean
at the top of the list in java
I have come across another question similar to this on stackoverflow, however, that answer overwrites the first name.
What i have right now is:
if (outputFile.exists()) {
try {
RandomAccessFile output = new RandomAccessFile(outputFileName, "rw");
output.seek(0);
output.write(headerComments.getBytes());
output.close();
} catch (IOException e) {
System.out.println("IO Exception");
}
}
File image: http://postimg.org/image/pu043d0kv/