Java: how to write formatted output to plain text file
<p>I am developing a small java application. At some point i am writing some data in a plain text file. Using the following code:</p>

<pre><code>Writer Candidateoutput = null;
File Candidatefile = new File("Candidates.txt"),
Candidateoutput = new BufferedWriter(new FileWriter(Candidatefile));
Candidateoutput.write("\n Write this text on next line");
Candidateoutput.write("\t This is indented text");
Candidateoutput.close();
</code></pre>

<p>Now every thing goes fine, the file is created with the expected text. The only problem is that the text was not formatted all the text was on single line. But if I copy and paste the text in MS Word then the text is formatted automatically.</p>

<p>Is there any way to preserver text formatting in Plain text file as well?</p>

<p>Note: By text formatting I am referring to <code>\n</code> and <code>\t</code> only</p>
