I have a Java program that uses PrintWriter to write text to a file using lots of .println() statements, everything works fine. What I want to know is: is there a way to write to a specific line in the output file?
for example If my program writes 10 lines to the output file using 10 .println() statements. Is there a way that at the end of my program, I can tell it to write a line to the 3rd line of text in the file and that would then bump the remaining 7 lines down by one line to make room for the new 3rd line?
Any help would be greatly appreciated, Thanks in advance, Stephen.