Thread: C file search

  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    21

    C file search

    I have a file with 13 columns of data and 10000 rows. The first column is identical for each row. The second row is the date. I need to read this file and extract the data for a specific date into a separate file. Each date has approximately 500 records.

    What is the best way of doing this? What method should I use to search the first occurrence of the date and then read all the records for that date into a different file?

    Any suggestions please...

    Thanks

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    So read in a row, parsing it into columns (if it's nicely formatted, fscanf will work for you). If the second column is the date you want, write it out. If not, don't.

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. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  3. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  4. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  5. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM