Как разобрать TXT-файл с помощью C ++ - PullRequest
0 голосов
/ 25 сентября 2019

это текстовый файл для чтения.в определенном формате

с использованием функций sstream и getline. Мне нужно извлечь id, title, author, abstract и сохранить все соответствующие слова в векторе.Я застрял.

using namespace std;

int main(){

string filename;
cout<<"Please enter the name of the collection file: ";
getline(cin,filename);

fstream file(filename.c_str());

if(!file)
{
    cout<<"Error!! opeaning the file. Please check your file name. \n";
    return EXIT_FAILURE;
}

else{
...