title: How to add print results to another file
body: <p>I am try to get what it printed from <code>text.txt</code>, make a new file that is <code>text2.txt</code> and put the print results in that file. All I know how to do is read and use the first one.</p>
  
  <pre><code>try{
      sc = new Scanner(new File(filename));
  }
  catch (Exception e){
  
      System.exit(1);
  }
  </code></pre>