Writing to a text file, then appending to it
I need to write a heading in a text file and then append text after this e.g:
heading
--
text1
text2
At the moment what i get is:
heading
-
text1
heading
--
text2
publicvoid displayProgress()
{
try
{
File outputFile =new File("Output.txt");
BufferedWriter bw =new BufferedWriter(new FileWriter(outputFile,true));
bw.append("" + (currentProcess + 1) +"\t" +"\t" +"\t" + status +"\t" +"\t" +"\t" + priority.get(currentProcess) +"\t" +"\t" +"\t" + time +"\t" +"\t" +"\t" + time +"\t" +"\t");
bw.append("\n");
bw.flush();
}
catch(IOException e)
{
e.printStackTrace();
}
}
Please suggest why this is happening.
Cheers anyone

