This code snippet will help you append data in text form to a file.
BufferedWriter out = null;
try {
out = new BufferedWriter(new FileWriter(รข"filename", true));
out.write("String");
} catch (IOException e) {
// error processing code } finally
{
if (out != null) {
out.close();
}
}