I already told you with the code I posted above. It does exactly what you are asking. I just put the numbers in an array of integers rather than in individual variables. Just put the code I gave you in a loop that uses fgets() to read the file one line at a time, so that you know the begenning of each line.
Or if you know there will always be 4 numbers on each line and that it will never ever be anything else
int userID;
int time;
int from;
int to;
FILE*fp = fopen("filename.txt","r");
while( fscanf(fp,"%d%d%d%d", &userID,&time,&from,&to) > 0)
{
// do something with the data
}
fclose(fp);