Read 1000 Lines from text file in a single shot ........
-
Hi, Below is the line of code(C++) for Reading the Textfile line by line. CString = strFilePath; // text path file path ifstream Textfile; Textfile.open(strFilePath,ios::in); std::string value; while(!Textfile.eof()) { getline(Textfile,value); // Read line by line... } Textfile.close(); Now the question is I am having 40MB text file size. I need to read 1000 Lines in a single shot (And upto read 1000 times to reach the whole 40 MB size) not line by line. How to do this? reg, Subbu
-
Hi, Below is the line of code(C++) for Reading the Textfile line by line. CString = strFilePath; // text path file path ifstream Textfile; Textfile.open(strFilePath,ios::in); std::string value; while(!Textfile.eof()) { getline(Textfile,value); // Read line by line... } Textfile.close(); Now the question is I am having 40MB text file size. I need to read 1000 Lines in a single shot (And upto read 1000 times to reach the whole 40 MB size) not line by line. How to do this? reg, Subbu