fscanf and scanf aren't very flexible for parsing. It is difficult to do proper validation of data. Lots of reasons for not using (f)scanf.
That said, here's a trick to make it work for you. This will recognize whether the first number is the only number. The restriction is there can be no white space following this number. If you must accept "1234 " as the first line, this won't work.
You should also understand that - because of the way (f)scanf works, leading blank lines will be skipped. (f)scanf skips over all leading white space - including newlines.
char peek = ' ';
if ( fscanf(fp, "%d%c", &value, &peek) == 2 && peek = '\n' )
{
while ( fscanf(fp, "%d", &value) == 1) )
{
}
}
It should be obvious the code extracts the character following the first number and checks whether this character is a line feed.