The %s modifier for scanf only stops at white space (or EOF or when theres an error). You can use the %[ modifier, so something like
Code:
fscanf(fp, "%19[^,],%19s", word1, word2);
The %[] specifies a group of letters to accept, so %[abc] would only read and store consecutive letters that are 'a', 'b' or 'c' as a string. The first 'd', or '?' or '7' or space, etc would stop it. The ^ at the beginning of the group negates that, so that example is saying "give me at most 19 characters, so long as they are NOT a comma and store it, then read a comma, then at most 19 more chars to store". The second one doesn't need a %[ because there doesn't appear to be a trailing comma at the end of a line.
Also note, I left off the & from word1 and word2. Presumably they are the names of arrays, or are char pointers that point to valid memory to store the results. Thus the & would be wrong, resulting in pointer to array of char or pointer to pointer to char, respectively, instead of just "pointer to char", which is what %s and %[ expect. Generally speaking, you don't need the & for string variables with scanf. Also note the 19. That is an example of a maximum length specifier, which avoids buffer overflows. 19 would be room for 20 characters, 19 letters plus the null terminator. If your arrays for word1 and word2 are of size 20, then you put a 19 in the scanf. If they're size 100, put a 99, etc. Always leave room for the null.
Alternatively, you could use strtok or strchr combined with strcpy, but it's a bit more work and probably not worth it here.
EDIT: The explanation of the "%19[^,]..." bit should read something like this (bold text added for clarity):
"...then read a comma, then at most 19 more chars, up to the first white space to store"