This is bare bones C, no fancy stuff. It will work if your data has the format you described, i.e. space separated words in a text file with the number of each line right before the newline character, and each line starts with at least one word that is not your number. Size of the buffer can change as you like, it will only affect performance. Also, your file needs to have at least one line in the format you describe.
FILE *f;
char bf[2048];
char *p, *p1;
int line, i, num;
f = fopen("mydatafile.txt", "r");
if (f)
{
line = 0;
while (!feof(f))
{
fgets(bf, sizeof(bf), f);
p1 = bf;
p = strchr(bf, '\n');
while(p)
{
*p = 0;
i = 0;
while (isdigit(p[--i])) ;
num = atoi(p+i+1);
p[i] = 0;
printf("line %d: %s number = %d\n",++line, p1, num);
p1 = p+1;
p = strchr(p1, '\n');
}
}
fclose(f);
}
For your sample data the output is:
line 1: Audi number = 2014
line 2: Wall Street number = 1995
line 3: The number of words used in one line may vary number = 9999