#include <stdio.h>
#include <string.h>
int main(void) {
char imposta_tratt[300];
FILE *fp;
fp = fopen("file.txt", "r");
if (fp == NULL)
return 0;
ssize_t size = fread(imposta_tratt, 1, sizeof(imposta_tratt), fp);
fclose(fp);
imposta_tratt[size] = 0;
printf("%s", imposta_tratt); // sample print
char tratt[size][20];
const char delim[2] = ",";
int t = 0;
char *token = strtok(imposta_tratt, delim);
while (token != NULL) {
if(strlen(token) < 20)
strcpy(tratt[t], token);
token = strtok(NULL, delim);
t++;
}
for(int i = 0; i < t; i++){
printf("\n%s", tratt[i]); // sample print
}
}
0,30,25,10