fscaf

This is a discussion on fscaf within the C Programming forums, part of the General Programming Boards category; can someone please tell me how to read in a record that has variable length fields. The fields are delimited ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    9

    fscaf

    can someone please tell me how to read in a record that has variable length fields. The fields are delimited by commas.

    The fields to be read are:
    Student Number (5 digits)
    Student Name (25 characters max.)
    Curriculum Code (3 characters)
    8 Class Work Grades (2 characters max., may be : a+, a, a-, b+, b, b-, c+... f)
    4 Test Grades (3 digits max.)
    Final Exam (3 characters max., [not a mistake!!])

    Sample Record:
    43695,robert hilling,dpi,a+,c-,c,b+,b,d,a,f,100,88,93,82,93

    Any Help would be greatly appreciated.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    88
    read in the whole line with fgets() and get the parts by using strtok (string.h)
    Hope you don't mind my bad english, I'm Austrian!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with fscaf() to getc() and fprintf() to putc()
    By otchster in forum C Programming
    Replies: 14
    Last Post: 10-30-2005, 10:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21