Problem of reading file!!

This is a discussion on Problem of reading file!! within the C++ Programming forums, part of the General Programming Boards category; 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 ...

  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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,424
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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

  4. #4
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,424
    get, getline, basic_string::erase
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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, 01:46 PM
  5. Problem reading file
    By winsonlee in forum C Programming
    Replies: 2
    Last Post: 04-23-2004, 06:52 AM

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