You need to post code on where you are stuck; that is the best way to get help.
Anyway, here is some rough code to help you identify where your issues may be. I have kept it simple to allow you to follow through with how vanilla C does I/O.
#include <stdio.h> /* snprinf, fprintf fgets, fopen, sscanf */
int main(void)
{
char line_buffer[64];
FILE* infile = fopen("yourfile.txt", "r"); /* open file for reading */
while(fgets(line_buffer, 64, infile) != NULL)
{
char set_name[8]; /* construct a string w/ the set number */
snprintf(set_name, 8, "SET %c:", *(line_buffer+4)); /* no. is 5th char */
fprintf(stdout, "%s ", set_name); /* fprintf w/ stdout = printf */
int set[8];
int ind = 0;
for(int i=7; line_buffer[i]!='\0';) /* start from first number and end */
{ /* when string ends, denoted by the '\0' sentinel */
int n; /* using pointer arithmetric, read in and store num & consume */
sscanf(line_buffer+i, "%d %n", set+ind, &n); /* adjacent whitespace */
i += n; /* n from sscanf tells how many chars are read in */
fprintf(stdout, "%d ", set[ind]);
ind +=1;
}
fprintf(stdout, "\n");
}
return 0;
}