I am reading Comma delimited Large .txt files(About 50 Mb).
Currently I am using the method below to step through the lines in the file.
I have one other application that Read the exact same .txt file that I do.
That application will reach the end of the textFile in 5 Seconds while my method below will do it in 50 seconds. (I dont know what method that application uses)
So what I wonder is if there is a more effective way to read the txtFile than I do.
I have heard and red around that open the file in binary mode will be more efficient but I dont know the method to do this and what data I will get from ifstream.
The lines in the txt file that I read look like this:
Monday,1,2
Tuesday,2,3
Wednesday,3,4
std::string Text1;
double Number1 = 0;
doulbe Number2 = 0;
char Comma;
ifstream LargeFile("C:\\LargeFile.txt");
while( getline(LargeFile, Text1, ',') )
{
LargeFile >> Number1;
LargeFile >> Comma;
LargeFile >> Number2;
LargeFile.get();
}
MessageBox::Show("File has Reached End");