Read part of file

This is a discussion on Read part of file within the C Programming forums, part of the General Programming Boards category; Problem is read first n-th part of text file. Is there any function to get character count of file or ...

  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    7

    Read part of file

    Problem is read first n-th part of text file. Is there any function to get character count of file or somethink similar? If the file have 48 characters and I want only first half part of the file the result will be 24, whether I want first third part of text file the result will be 16 and so on.
    Please is there some function for this or how to create this function. Thank's.

  2. #2
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,458
    fopen as binary
    fseek to the end
    ftell
    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. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  3. c script help to read a file & update
    By indy in forum C Programming
    Replies: 8
    Last Post: 12-01-2003, 10:32 AM
  4. 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