I would use fscanf(fp, "%[^|] %[^|] etc. ,and take the data right into your struct members,
This is an example of using sscanf(), where the record members are separated by commas and one space:
Code:
sscanf(buff, "%[^,], %[^,], %[^,], %d ", videos[i].title,videos[i].actor,videos[i].genra,&videos[i].rating);
//printf(" title: %s\n actors: %s\n genra: %s\n rating: %d\n\n",
// videos[i].title,videos[i].actor,videos[i].genra,videos[i].rating); getchar();
The print out line is just to confirm that you got what you thought you got, during development. fscanf() has the same data format specifiers, and return type.