Thread: Remove text from external file....

  1. #1
    Unregistered
    Guest

    Remove text from external file....

    To whom it may concern,

    I'm working on this program that require to remove text from the external file:
    Ex. test.dat
    I like this
    you like that
    Bluh bluh

    int main()
    {
    istream read;
    char temp[100];

    //read from the external file line by line and store it somewhere... how?
    cout <<"Enter line or the first word to be remove:" ;
    cin.get( temp, 100, '\n');
    //user enter "I like this"
    //and then compare the two line or word.. then delete the alike from the "test.dat". So, what it has left is just:

    "test.dat"
    you like that
    bluh bluh

    }

    Thank you in advance.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793

  3. #3
    Unregistered
    Guest
    The examples that you were giving me from the faq page is just an example is reading text from the file and cout to the screen. What I need is to read text from the file and delete text from that file...

    thank you,

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    589
    Read text from file into an array
    delete text you don't want from array.
    Write array back to file.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. How to use FTP?
    By maxorator in forum C++ Programming
    Replies: 8
    Last Post: 11-04-2005, 03:17 PM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. Outputting String arrays in windows
    By Xterria in forum Game Programming
    Replies: 11
    Last Post: 11-13-2001, 07:35 PM