I have log file with around 2000 lines in it. I have gone through first round of formatting. However, I met with difficulty to format my log to what I want for the moment:
Current:
line1: 9/13/2011 3:58:05 AM, abef, 1234, ...
line2: 9/14/2011 3:58:05 AM, adef, 1234, ...
line3:
line4: 9/15/2011 3:58:05 AM, bcdef, 134, ...
line5: 3) sdad
line6: azd
line7: [] asdsdee234
line2014: 9/16/2011 3:58:05 AM, abcf, 1234, ...
What I want to achieve is to clean up the log to remove lines that do not begin with a date. So line 3, 5, 6 and 7 need to be removed.
Wanted result:
line1: 9/13/2011 3:58:05 AM, abef, 1234, ...
line2: 9/14/2011 3:58:05 AM, adef, 1234, ...
line3: 9/15/2011 3:58:05 AM, bcdef, 134, ...
line2010: 9/16/2011 3:58:05 AM, abcf, 1234, ...
or
Then dump result to disk using
File.WriteAllLines().