read and test the next file entry

while(fscanf(f_ptr,"%d",&dummy) != EOF)