I have a file that consists of dates like this:
12/01/2008
12/02/2008
12/03/2008
12/04/2008
12/05/2008
Now if I will read this file from beginning to end, this is a solution:
String^ FilePath = "C:\\DateFile.txt";
String^ GetLine = "";
StreamReader^ Read = gcnew StreamReader(FilePath);
while(Read->Peek() >= 0 )
{
GetLine = Read->ReadLine();
if( GetLine == "12/[B]04[/B]/2008" )
{
//Do something
}
}
Read->Close();
Now is my problem as follows. This file is very large, about 50 MB and consists of Dates in an ascending order.
As I have done a test that I will only want to start reading this file from the date "12/[B]04[/B]/2008" so reading this file from beginning to end is not effective.
How is it possible to start read this file from this date ? What could be an approach to this ?
"12/[B]04[/B]/2008"