title: Add a Header to the Beginning of Each Page in a Text File in Java
body: <p>I am trying to add a header to the beginning of each page in Java. I am printing my console output to a file as well. All of the examples I can find are for PDF files but I need to print to a text file for later data transfer and use iText which I cannot use. Any suggestions would be awesome. Here is how I am printing so far:</p>
  
  <pre><code>  PrintStream out = new PrintStream(new FileOutputStream("example.txt"));
    System.setOut(out);
  </code></pre>