going to a certain spot in a file...

This is a discussion on going to a certain spot in a file... within the C++ Programming forums, part of the General Programming Boards category; wassap. we'll i'm working on a project right now, and i need to be able to jump to a certain ...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    106

    going to a certain spot in a file...

    wassap.
    we'll i'm working on a project right now, and i need to be able to jump to a certain spot in the file, delete the info there, and then resave the file. ex (in file itself, on hard drive):

    TOM
    JOE
    BOB
    MARY <----need to jump right to this spot, and delete this name
    JANE
    HARRY

    the only method i know is to read in the entire file, search the entire file, erase that name, then rewrite the file. this is a bit tedious. anyways, any help would be appreicated.
    thanks a lot

  2. #2
    Ted
    Ted is offline
    Registered User
    Join Date
    Aug 2001
    Posts
    52
    Every programming textbook includes a chapter on file processing.
    It covers sequential and random access processing. If you don't
    have a textbook or some other suitable How-To-Program book,
    you should get one. Other than that, you can start by researching seekg(), seekp(), tellg(), tellp(), the IOS class
    members for open_mode (in, out, ate, app, trunc, ...), write(),
    sizeOf(), clear(), ifstream(), ...

    hth,

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    106
    i'll try that. thanks

  4. #4
    Unregistered
    Guest
    Could you please give us a concrete example?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Data Structure Eror
    By prominababy in forum C Programming
    Replies: 3
    Last Post: 01-06-2009, 09:35 AM
  2. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 04:39 AM
  3. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 11:12 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21