how to manipulate data in .txt file

Discussion in 'Java' started by David, Jul 28, 2003.

  1. David

    David Guest

    there r some student info stored in a text file, the fields r listed as
    following:
    Student_id Student_name assignment date
    how to manipulate this file by adding, delete, search and change a specified
    field value.
    who can give me some hints, code or related article link on net

    thanks

    --
    Bi Hongliang / David
     
    David, Jul 28, 2003
    #1
    1. Advertising

  2. David

    _.-= Guest

    To avoid working with all that code, what we do is use a database ;-)

    "Roedy Green" <> wrote in message
    news:...
    > On Mon, 28 Jul 2003 20:25:44 +1200, "David" <>
    > wrote or quoted :
    >
    > >Student_id Student_name assignment date
    > >how to manipulate this file by adding, delete, search and change a

    specified
    > >field value.
    > >who can give me some hints, code or related article link on net

    >
    > The easiest way to do this is to suck the entire file into RAM into
    > some sort of tree structure. Do you pruning inserts etc. on the tree.
    > Then write it out again to a text file when done.
    >
    > The only other plausible approach is to read the text file up to the
    > point of the change, copying to another file, then copy in the change,
    > then copy the rest of the file.
    >
    > If you have two changes to make, sort them before you start. This is
    > way it was always done back when unit records (punch cards, paper
    > tape, and mag tape) were your only options.
    >
    > --
    > Canadian Mind Products, Roedy Green.
    > Coaching, problem solving, economical contract programming.
    > See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    _.-=, Jul 30, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dave
    Replies:
    1
    Views:
    348
    Mike Wahler
    Jan 22, 2005
  2. Sameen
    Replies:
    2
    Views:
    484
    Victor Bazarov
    Aug 29, 2005
  3. Jochen Brenzlinger
    Replies:
    7
    Views:
    5,879
    Roedy Green
    Sep 15, 2011
  4. Cool Wong
    Replies:
    3
    Views:
    129
    James Edward Gray II
    Jun 20, 2007
  5. Ram
    Replies:
    3
    Views:
    283
    Tad McClellan
    Apr 26, 2007
Loading...

Share This Page