Thread: File reading problems

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    2

    File reading problems

    I have to read several (in excess of 10000) arrays of 432 bytes of logged data from a file and process the data.

    I have used

    while (fread(&Input.WriteArry,1,432,Ffp)==1)

    to read the file. This only reads the first 263 arrays, fseek also shows this to be the end of the file. I have confirmed with a hex editor that all the arrays of data are present.

    Please advise.

    Best regards,

    VR6_Nut

  2. #2
    Registered User ssharish2005's Avatar
    Join Date
    Sep 2005
    Location
    Cambridge, UK
    Posts
    1,732
    So what format the file is in?

    Make a quick search on the form on how to read huge file. You might come up with some dozens of thread with the same topic.

    -ssharish
    Life is like riding a bicycle. To keep your balance you must keep moving - Einstein

  3. #3
    Registered User
    Join Date
    Oct 2008
    Posts
    1,262
    Quote Originally Posted by VR6_Nut View Post
    I have to read several (in excess of 10000) arrays of 432 bytes of logged data from a file and process the data.

    I have used

    while (fread(&Input.WriteArry,1,432,Ffp)==1)

    to read the file. This only reads the first 263 arrays, fseek also shows this to be the end of the file. I have confirmed with a hex editor that all the arrays of data are present.

    Please advise.

    Best regards,

    VR6_Nut
    Have you opened the file as a binary file? Or did you just use the default ASCII one?

    If that's not the problem, I can't imagine anything but a problem somewhere else in the code.

  4. #4
    Registered User
    Join Date
    Feb 2009
    Posts
    2
    Thanks have resolved issue when looking at other threads

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A development process
    By Noir in forum C Programming
    Replies: 37
    Last Post: 07-10-2011, 10:39 PM
  2. Newbie homework help
    By fossage in forum C Programming
    Replies: 3
    Last Post: 04-30-2009, 04:27 PM
  3. Basic text file encoder
    By Abda92 in forum C Programming
    Replies: 15
    Last Post: 05-22-2007, 01:19 PM
  4. help with text input
    By Alphawaves in forum C Programming
    Replies: 8
    Last Post: 04-08-2007, 04:54 PM
  5. I have some problems reading struc from file
    By samc2004 in forum C Programming
    Replies: 4
    Last Post: 12-18-2003, 02:47 PM