从文件中提取所需的单词,然后删除所有其他单词

问题描述

在这段代码中,我正在从文件中提取特定的单词,但是编码不仅在获取所需的单词,而且还包含其他单词,

类似

'bilal khan' found
'9087' found
'sssss' found
'ixing' found

当我只想从9087文件中提取第二个单词时。

该怎么做?

我的代码

while (fgets(string,70 - 52,fr))
{
    word = strtok(string,",");

    int diff;
    while (word != NULL)
    {
        diff = strcmp(string,word);
        if (diff == 0)
        {
            printf("'%s' found\n",word);
        }
        word = strtok(NULL,");
    }
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)