title: How to read a text file and append a new row with more details in file?
body: <p>I am reading below  text file content and write it to a console using below code.</p>
  <pre><code>file content
      
     james;mask;1980
     Mos;josh;1960
  </code></pre>
  <p>how can i append a new line calculating a year from year of birth in a new column</p>
  <pre><code>public class Readfile {
  
      public static void main(String[] args) {
          
          // Create file
          File file = new File(&quot;/Users/James/documents/Huber.txt&quot;);
  
          try {
              // Create a buffered reader
              // to read each line from a file.
              BufferedReader in = new BufferedReader(new FileReader(file));
              String ch;
              // Read each line from the file and echo it to the screen.
          
              while ((ch = in.readLine()) != null) {
                  
                      System.out.println(ch);
  
          
              
              }
              
              // Close the buffered reader
              in.close();
  
          } catch (FileNotFoundException e1) {
              // If this file does not exist
              System.err.println(&quot;File not found: &quot; + file);
  
          } catch (IOException e2) {
              // Catch any other IO exceptions.
              e2.printStackTrace();
          }
      }
  
  }
  </code></pre>