I have an example log that i am trying to find the best solution to get me pieces of information: Mainly time stamp and a specific string.
Example Log Output: Each are on 1 Line
####<Jun 22, 2012 12:54:18 PM CDT> <Notice> <WebLogicServer> <lname> <dname> <main>
<<WLS Kernel>> <> <BEA-000360> <Application started in RUNNING mode>
Each log line has the 4 beginning # tag followed by <Timestamp> all pieces that are relevant to my scenario have the <> enclosed brackets and i want to have an array of information where the index is based on left to right reads.
For each <> bracket, i want to store its information in the lineArray.
using (var reader = new StreamReader(@"C:\Projects\test.txt"))
{
foreach(var line in ReadLines(reader))
{
//add logic to parse and read info into brackets
String sLine = (String)line;
String splitD = sLine.Split("<>")[0];
}
}
Well, I’m not a regexp guru, but this should work:
Output (actual matches between
-chars):Output: