Link to home
Start Free TrialLog in
Avatar of obad62
obad62

asked on

Read Ascii data file -Qt

Hi,
I have this smaple of data for 12 record from the compleat file which has 41000 record so, what is the easy way to read the first 50 record as ascii data into Qt c++ programe. I have read there are Qfile and Qdata streame ...but which approperate. Also, are there any useful links or code for that.

Thanks in advanced

Sample.xlsx
Avatar of irfan_omair
irfan_omair
Flag of United States of America image

Hi Obad,

>>>I have this smaple of data for 12 record from the compleat file which has 41000
I am sorry I could not understand your question good, Can you please explain a bit, Do you mean that You have a data base which is having 41000 records? IS that in some RDBMS or DBMS like oracle or mySql sort of data base,? OR is that simple stored in some text file???
WHat do you mean by " I have sample of Data for 12 Records" ????
please explain
Avatar of obad62
obad62

ASKER

thanks for your responce
I have excel file which  has 41000 row I need to read 10 rows only  i used this code but nothing :

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main () {
string line;
ifstream myfile ("example.txt");
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
cout << line << endl;
}
myfile.close();
}

else cout << "Unable to open file";

return 0;
}
ASKER CERTIFIED SOLUTION
Avatar of irfan_omair
irfan_omair
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of obad62

ASKER

As I said to you problem in the file location