The rows are as in the example:
583-4-153-15601-4 '\t' Time Warp Trio '\t' Scieszka Jon '\t' 50 '\t' 50
583-0-133-15601-2 '\t' Djemte e rruges pal '\t' Ardit Zotaj '\t' 50 '\t' 50
So Every string is separated by a tab. Basically it contains the information for a book.
ISBN-TITLE-AUTHOR-PRICE-NO. OF COPIES.<
//583-4-153-15601-4 '\t' Time Warp Trio '\t' Scieszka Jon '\t' 50 '\t' 50
//583-0-133-15601-2 '\t' Djemte e rruges pal '\t' Ardit Zotaj '\t' 50 '\t' 50
I have done this work so far but it doesn't give the right output me in the cmd.
#include <iostream>
#include <string>
#include <fstream>
#include <sstream>
using namespace std;
int main()
{
ifstream fin;
fin.open("bookdata.txt");
string line;
string isbn, title, author;
int var1 = 0;
int var2 = 2;
while (!fin.eof())
{
getline(fin, isbn, '\t');
getline(fin, title, '\t');
getline(fin, author, '\t');
fin >> var1;
fin >> var2;
}
cout << isbn << title << author << endl;
fin.close();
cout << var1 << var2 << endl;
}