title: How to read and update row in file with Java
body: <p>currently i creating a java apps and no database required
  that why i using text file to make it
  the structure of file is like this</p>
  
  <pre><code>unique6id username identitynumber point
  
  unique6id username identitynumber point
  </code></pre>
  
  <p>may i know how could i read and find match unique6id then update the correspond row of point ?</p>
  
  <p>Sorry for lack of information
  and here is the part i type is</p>
  
  <pre><code>public class Cust{
    string name;
    long idenid, uniqueid;
    int pts;
    customer(){}
    customer(string n,long ide, long uni, int pt){
          name = n;
          idenid = ide;
          uniqueid = uni;
          pts = pt;
    }
  
  
  FileWriter fstream = new FileWriter("Data.txt", true);
              BufferedWriter fbw = new BufferedWriter(fstream);
                  Cust newCust = new Cust();
  
                  newCust.name = memUNTF.getText();
                  newCust.ic = Long.parseLong(memICTF.getText());
                  newCust.uniqueID = Long.parseLong(memIDTF.getText());
                  newCust.pts= points;
  
              fbw.write(newCust.name + " " + newCust.ic + " " + newCust.uniqueID + " " + newCust.point);
              fbw.newLine();
              fbw.close();
  </code></pre>
  
  <p>this is the way i text in the data
  then the result inside Data.txt is</p>
  
  <pre><code>spencerlim 900419129876 448505 0
  Eugene 900419081234 586026 0
  </code></pre>
  
  <p>when user type in 586026 then it will grab row of eugene
  bind into Cust
  and update the pts (0 in this case, try to update it into other number eg. 30)</p>
  
  <p>Thx for reply =D</p>