strtok(), search for the whiutespaces in the lines, that counts the columns..
Or while reading, something like this:
Code:
int read = 0;
int a, b, c;
read = fscanf(file_pointer, "%d %d %d\n", &a, &b, &c);
if(read < 3)
// error happened, or line didnt hold three integers.
else
// success, we have our line, with three or more columns.