Thread: Extracting Information from Files

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    %s %d %d %d
    Don't lie to sscanf about the format of your strings.

  2. #17
    Registered User
    Join Date
    May 2011
    Posts
    26
    But that is the format..

    Example 45 40 40
    Second 62 61 63

    Is that not correct?

  3. #18
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Look at your first post:
    afile.txt contains:

    /*
    City Distance1 Distance2 AvgDistance

    Miami 50 60
    Montreal 90 65
    Vancouver 87 63

    Quzah.
    Hope is the first step on the road to disappointment.

  4. #19
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by Pztar View Post
    But that is the format..

    Example 45 40 40
    Second 62 61 63

    Is that not correct?
    I dunno. I figured when you said:

    Quote Originally Posted by Pztar View Post

    Miami 50 60
    Montreal 90 65
    Vancouver 87 63
    You were looking at the data file. I have this sneaking suspicion you're supposed to read two, compute the third, and then write three, but that's just a sneaking suspicion.

  5. #20
    Registered User
    Join Date
    May 2011
    Posts
    26
    Oh, no sorry. I just used that as an example. The actual file has more than 2 values in each line. What I'm suppose to do is, read in the files, store them and then apply another file that has the rules for what's suppose to happen, and in the end write to the initial files opened.

  6. #21
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    So, I guess you'd better get to work planning and writing...

    If you get stuck, post up your code and we'll see what we can do to help.

    But we are not going to do it for you. (Or at least I'm not...)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Extracting Files
    By man_of _my_word in forum C Programming
    Replies: 8
    Last Post: 12-23-2010, 01:31 PM
  2. Storing information created files.
    By GCNDoug in forum C Programming
    Replies: 12
    Last Post: 05-07-2007, 03:18 PM
  3. extracting value
    By braddy in forum C Programming
    Replies: 2
    Last Post: 03-13-2006, 03:09 PM
  4. Extracting information from a website?
    By gflores in forum Tech Board
    Replies: 2
    Last Post: 11-14-2005, 08:31 AM
  5. extracting files from a rar/zip
    By jverkoey in forum Windows Programming
    Replies: 2
    Last Post: 03-28-2003, 08:55 AM