Hi Gerry,
Thanks yes that was I have done too. However, I had to do some cleaning since for situations like:
Date: 6/7/2009 Test Form: A23
I had to check the position of "Date:" and then extracting after ":" or same thing for "Test From:" etc using IndexOf() and Substring() methods.
Any idea if I'm on a right track?
Thanks.
Main Topics
Browse All Topics





by: _Gerry_Posted on 2009-07-13 at 19:58:09ID: 24846016
There's more than one way to do this.
) ) != null)
xt");
Line by line using something like
using System.IO;
...
using (var reader= new StreamReader("myfile.txt")
{
var myline=string.Empty;
while ((myline=reader.ReadLine()
{
// do something with the line....
}
}
or read the whole file into memory and work with it there:
using System.IO;
...
var thewholefile = File.ReadAllText("myfile.t
use string.split() etc. to break up the file afterwards.
I think I read somewhere that the first method is actually faster to execute.
As for what you do to the lines to parse them depends entirely on what you are expecting to find in the file :-)