edit as question is unanswered
I have a filtered output based on 1 criteria (first 3 numbers are 110,210 or 310,to give 3 distinct groups) to console from streamreader.
string input = File.ReadAllText("file.dat");
var result = Regex.Matches(input, "(210|310|410).*?([A-C]{3})([0-9]{5})")
.Cast()
.Select(m => new {
P1 = m.Groups[1].Value,
P2 = m.Groups[2].Value,
P3 = Convert.ToInt32(m.Groups[3].Value)
})
.GroupBy(x => new{x.P1,x.P2})
.Select(x=>String.Format("{0} {1} {2}",x.Key.P1,x.Key.P2,x.Sum(y=>y.P3)))
.ToList();