Thread: Need Advice in reading files

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    2

    Question Need Advice in reading files

    Hi,

    I need some advice regarding reading files. Basically I want to read a file, just a normal ASCII tx file. Then analyse that data. The files will be very long in length up to 30Mb.

    Is C the best language to do this in? and are there any books specific to c reading, writing and data manipulation. And should i use fopen or is there another function that will help.

    Any guidance would be appriciated.

    Many thanks

    Jon

  2. #2
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Yes I, personally, believe that C is a great language to do what you want with files. Nothing personal or anything, but it sounds as though you don't really know the language. Do you? But, to answer your question, C is quite capable of reading and manipulating files quite profficiently, if I might say.

    --Garfield
    1978 Silver Anniversary Corvette

  3. #3
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    Oh, sorry I didn't answer that other question. Yes, you should use fopen and open the file. Then you can do whatever you want with the file. If you open it up to read, you can read the contents with fgets and so forth. And if you open it for writing, you can use functions like fputs. This would be the means of working with files in C.

    --Garfield
    1978 Silver Anniversary Corvette

  4. #4
    Registered User ivandn's Avatar
    Join Date
    Oct 2001
    Posts
    49
    This may be a stupid remark, but is it optimal to be storing 30MB of data in flat files?
    Ivan

  5. #5
    the Corvetter
    Join Date
    Sep 2001
    Posts
    1,584
    No, it's not.
    1978 Silver Anniversary Corvette

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reading User Defined Files
    By Necrofear in forum C++ Programming
    Replies: 17
    Last Post: 06-30-2006, 12:55 AM
  2. Linking header files, Source files and main program(Accel. C++)
    By Daniel Primed in forum C++ Programming
    Replies: 3
    Last Post: 01-17-2006, 11:46 AM
  3. reading files
    By hiya in forum C++ Programming
    Replies: 7
    Last Post: 05-21-2005, 11:40 AM
  4. A little help reading from files...
    By Invincible in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2002, 10:43 AM
  5. problem reading files in C
    By angelfly in forum C Programming
    Replies: 9
    Last Post: 10-10-2001, 11:58 AM