Re: Reading a table



On Nov 26, 11:04 am, Stephen.Schoenber...@xxxxxxxxx wrote:
Hello,

My C is a bit rusty (.NET programmer normally but need to do this in
C) and I need to read in a text file that is setup as a table. The
general form of the file is

00000000 USNIST00Z 00000000_00 0 000 000 000 0000 000

I need to read the file line by line and eventually parse out each
piece of the file and store in arrays that correspond to the specific
line. array1[1] would be the first entry in the first line and so on
and so forth.

Any suggestions would be great!

fopen() to open the file.
fgets() to read in one line at a time.
write your own function to parse it, because only you know the format.

HTH
.



Relevant Pages

  • Re: Question on MODULE_VERSION macro
    ... > I have not yet fully understood why you want to parse every source file. ... > calculating the sum of the whole file? ... -- Rusty Russell. ...
    (Linux-Kernel)
  • Reading a table
    ... My C is a bit rusty (.NET programmer normally but need to do this in ... piece of the file and store in arrays that correspond to the specific ... array1would be the first entry in the first line and so on ...
    (comp.lang.c)
  • Re: Parse/Template Function
    ... emulates some or all of the functionality of PARSE (sorry I'm a little rusty). ... Support the Original G95 Project: http://www.g95.org ... Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html ...
    (comp.lang.rexx)
  • Re: Parse/Template Function
    ... emulates some or all of the functionality of PARSE (sorry I'm a little ... rusty). ...
    (comp.lang.rexx)