Thread: Problem of reading file!!

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    78

    Problem of reading file!!

    Hi all,
    I am reading one text file.I have this line:

    !seal_indicator_assembly_master_dwg.prt

    I want to copy only "seal_indicator_assembly_master_dwg.prt" out of above line neglecting exlemetry mark(!).

    How can i do this?

  2. #2
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    You can read 1 char into temp var - and the rest into your string var

    Or you can read the whole line and then - if the first char is ! - remove it from the string
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    78
    do we have any standard function for that?

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    get, getline, basic_string::erase
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File transfer- the file sometimes not full transferred
    By shu_fei86 in forum C# Programming
    Replies: 13
    Last Post: 03-13-2009, 12:44 PM
  2. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  3. Replies: 20
    Last Post: 06-12-2005, 11:53 PM
  4. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  5. Problem reading file
    By winsonlee in forum C Programming
    Replies: 2
    Last Post: 04-23-2004, 06:52 AM