You have to skip \n that was not read by [^\n] format to go to the next line
Code:
#include<stdio.h>
int main() {
char read_word[500];
int res;
int read =0;
while((res = scanf("%499[^\n]\n", read_word)) == 1) {
printf("%s\n", read_word);
read++;
}
printf("Read=%d, res=%d\n", read, res);
}
Output
Code:
$ ./test < test.txt
ATHROCYTES
DISHLIKE
IRRECOVERABLENESSES
EMBRITTLEMENTS
YOUNGS
OVERPLOTS
FED
SQUALLS
SKINFULS
CANNAS
COUNTERGUERILLAS
FINIAL
VACATIONERS
WINTRINESSES
...and so on...
Read=15, res=-1