title: Append a String to the end of the existing String with specific position in a text file in Java
body: <p>Exp -
  In a text file we have the following topics with some description. </p>
  
  <hr>
  
  <p><strong>#Repeat the annotation</strong></p>
  
  <p>It is the major topic for .....</p>
  
  <p><strong>#Vector analysis</strong></p>
  
  <p>It covers all the aspects of sequential....</p>
  
  <p><strong>#Cloud Computing</strong></p>
  
  <p>Create header accounts for all the users</p>
  
  <hr>
  
  <p>We have to add / append new Tags to the Topics in specific line
  For exp-</p>
  
  <p><strong>#Repeat the annotation #Maven build</strong></p>
  
  <p><strong>#Cloud Computing #SecondYear</strong></p>
  
  <p>File f = new File("/user/imp/value/GSTR.txt");</p>
  
  <pre><code>    FileReader fr = new FileReader(f);
      Object fr1;
      while((fr1 = fr.read()) != null) {
  
          if(fr1.equals("#Repeat the annotation")) {
              FileWriter fw = new FileWriter(f,true);
          fw.write("#Maven build");
          fw.close();
  
  
          }
      }
  </code></pre>
  
  <p>****** #Maven is getting added to the last line of the text file but not at the specific position next to the topic     </p>