Some useful functions to parse text:

feof Checks if we've reached the end of the file
Usage: if(!feof(fp)) { /* read more lines */ }

fgets Grabs one line of input.
Usage: fgets(szLine, 256, fp);

sscanf Reads a format of variables.
Usage: To read three floating values: sscanf(szBuffer, "%f %f %f", &fV1, &fV2, &fV3);

strcmp Returns 0 if both strings are the same.
Usage: if(strcmp(szWord, "VERTEX") == 0) { /* caught vertex keyword*/}