Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3991724
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:39:01+00:00 2026-05-20T06:39:01+00:00

currently i creating a java apps and no database required that why i using

  • 0

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

unique6id username identitynumber point

unique6id username identitynumber point

may i know how could i read and find match unique6id then update the correspond row of point ?

Sorry for lack of information
and here is the part i type is

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();

this is the way i text in the data
then the result inside Data.txt is

spencerlim 900419129876 448505 0
Eugene 900419081234 586026 0

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)

Thx for reply =D

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:39:01+00:00Added an answer on May 20, 2026 at 6:39 am

    Reading is pretty easy, but updating a text file in-place (ie without rewriting the whole file) is very awkward.

    So, you have two options:

    1. Read the whole file, make your changes, and then write the whole file to disk, overwriting the old version; this is quite easy, and will be fast enough for small files, but is not a good idea for very large files.

    2. Use a format that is not a simple text file. A database would be one option (and bear in mind that there is one, Derby, built into the JDK); there are other ways of keeping simple key-value stores on disk (like a HashMap, but in a file), but there’s nothing built into the JDK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently creating a fullscreen Java application that will be like a kiosk application.
I'm currently creating a lot of classes that will access database using a connection
I'm currently creating an explicit reference to this in the outer class so that
I'm currently creating a user interface using WPF and would like to display a
i'm currently creating a database program in java and i am a bit stuck
Im currently creating a tile-based game for android. Using java via dalvik JVM. im
I'm creating a library that includes both Clojure and Java code, and would like
I'm upgrading a Java object that currently has XML representation in this spirit: <myObjects>
I'm currently starting a new Java application using the H2 database , but I
I'm beginner in java and I'm currently creating a card game like gin rummy

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.