Question: How do I make a c++ program that will search for keywords in a docutment or .txt or pdf etc or if I have a
How do I make a c++ program that will search for keywords in a docutment or .txt or pdf etc or if I have a bunch of files in a folder so I can search for keywords, and I wont have to scroll thorugh a bounch of documents to find the information that Im looking for and I want to searh by alphabt.
This is the code that I written.
#include
#include
#include
int main() {
std::string text = ",";
std::ifstream infile("myTest");
// insert code here...
infile.open("directory.txt", std::ios::in);
if (infile.is_open()) //if file opened {
while (!infile.eof())
{
std::string tempstring;
infile>> tempstring;
text+= tempstring+ " ";
}
}
else
{
}
std::cout <
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
