Hi,
I want to write some text at the end of a file. For the first time it worked but now it writes everything on the same line. Here is my code, any help on this.
Code:
Public void Write(String file, String txt) throws IOException {
FileWriter wr = null;
try {
Writer = new FileWriter(file, true);
wr.write(txt, 0, Txt.length());
} catch (IOException ex) {
ex.printStackTrace();
} finally {
if (wr! = null) {
wr.close();
}
}
}
There are no errors in the code but the text is not written in the exact location of the file. An idea? thank you in advance for your help.
Bookmarks