read spicific parts from a file

This is a discussion on read spicific parts from a file within the C++ Programming forums, part of the General Programming Boards category; How do you read a specific part of a file, for example a file with on the 5th line it ...

  1. #1
    Spanky devour89's Avatar
    Join Date
    Nov 2002
    Posts
    148

    Question read spicific parts from a file

    How do you read a specific part of a file, for example a file with on the 5th line it has age and you just want to get the age not anything else.

    any examples would be great
    thank you
    Dev C++
    Win XP/2k/98

    I DO NOT TAKE CLASSES I DONT GET HOMEWORK THIS IS NOT A HOMEWORK QUESTION!!!

    He's lean he's keen... He's the spank machine!

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    One solution is to keep track of the total lines you read in. Another solution is to keep track of "\n" you read in.

    Kuphryn

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, 04:02 AM
  2. Inventory records
    By jsbeckton in forum C Programming
    Replies: 23
    Last Post: 06-28-2007, 04:14 AM
  3. Replies: 3
    Last Post: 03-04-2005, 01:46 PM
  4. How to convert char read from file into string
    By cruxxe in forum C Programming
    Replies: 7
    Last Post: 05-22-2002, 02:09 PM
  5. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 09:57 AM

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