title: Add a specific string at the end of a line of file in JAVA
body: <p>My question is, <em>I guess</em>, pretty simple : </p>
  
  <p><strong>Given one <em>data.txt</em> file, how to add some String in a line, line by line in java?</strong> I don't want to delete the content, but simply add some string at the end of the line. Could you please show me a simple code for doing it? </p>
  
  <p>Ex, given <em>data.txt</em> file: </p>
  
  <pre><code>aaa bbb ccc
  eee fff ggg
  </code></pre>
  
  <p>Result after running the java program:</p>
  
  <pre><code>aaa bbb ccc ddd
  eee fff ggg hhh
  </code></pre>
  
  <hr>
  
  <p><strong>Additional question :</strong> is there a simple way to "insert" in the line line of a given file some String? If yes, how to do it too?
  Result:</p>
  
  <pre><code>aaa 111 bbb ccc
  eee fff 222 ggg
  </code></pre>
  
  <p>Thank you in advance for your help.</p>