I'm not 100% sure what you're doing and what does the solution need to do with ignore
. Please, provide an MRE (see @WhozCraig's comment) so that we can better understand your problem and provide better help.
Here is a solution which reads one file and writes it to the other file, but removes lines, which begin from the word "world" (words are considered to be separated by spaces):
#include <iostream>
#include <fstream>
#include <string>
int main()
{
std::ifstream inp("inp.txt");
std::ofstream out("out.txt");
std::string line;
while(getline(inp, line))
{
// If the word "world" followed by a space not found
if(line.find("world ") == std::string::npos)
// Then print the line to the output file
out << line << '\n';
// Otherwise do nothing
}
}
Example input file (inp.txt):
hello world
world hello
goodbye world
world goodbye
Output file (out.txt):
hello world
goodbye world