title: Java delete or modify one record in File
body: <pre><code>// Create file 
      FileWriter fstream = new FileWriter(fileName, true); 
      BufferedWriter out = new BufferedWriter(fstream); 
      out.write(c.toString()); 
      //Close the output stream 
      out.close(); 
  
      // Code I used to read record I am using | as a seperator name and id 
      String fileName = folderPath + "listCatalogue.txt"; 
      String line = ""; 
      Scanner scanner; 
      String name, id; 
      scanner = new Scanner(fileName); 
      System.out.println(scanner.hasNextLine()); 
      while (scanner.hasNextLine()) { 
          line = scanner.nextLine(); 
          System.out.println(line); 
          StringTokenizer st = new StringTokenizer(line, "|"); 
          name = st.nextToken(); 
          id = st.nextToken(); 
          catalogues.add(new Catalogue(name, id)); 
      } 
  </code></pre>
  
  <p>Above is the code to create file and read file, How can I do delete certain record, in File, what I have found from google  is delete the file but not delete certain record example I provide name, if match delete this record. As well as modify that record? Is it possible to do modify record using File?</p>