I have a .txt file that contains words and numbers like this
ID;Name;Surname;Phone;State;
And what i am trying is to skip this line, located at the begining, i have looked for it but i have no seen any case in which the words are separated by commas. I am using fscanf like this
void printCustomers(){
FILE *f;
f=fopen("people.txt","r");
if(f==NULL){
printf("Error");
}else{
do{
char id[5],name[11],surname[26],phone[30],state[10]
fscanf(f,"%4[^;];%10[^;];%25[^;];%50[^;];%9[^;]\n",id,name,surname,phone,state);
printf("ID:%s\nName:%s\nSurname: %s\nPhone: %s\nCity: %s\nState: %s\n",id,name,surname,phone,state);
}while(!feof(f));
fclose(f);
}
The file is like this:
ID;Name;Surname;Phone;State;1234;Harry;Ramirez;9874134;OT
What i want to skip is only this part
ID;Name;Surname;Phone;State;
I have tried using fgets but without success. I have also observed that when it prints the first lines, it writes strange letters, maybe because there is something else wrong in my code, which is more than likely. Any ideas? Thanks