public IColumnizedLogLine SplitLine(ILogLineColumnizerCallback callback, ILogLine line) { // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 // 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 // 03.01.2008 14:48:00.066 <rest of line> ColumnizedLogLine clogLine = new ColumnizedLogLine(); clogLine.LogLine = line; Column[] columns = new Column[3] { new Column { FullValue = "", Parent = clogLine }, new Column { FullValue = "", Parent = clogLine }, new Column { FullValue = "", Parent = clogLine }, }; clogLine.ColumnValues = columns.Select(a => a as IColumn).ToArray(); string temp = line.FullLine; FormatInfo formatInfo = _timeFormatDeterminer.DetermineDateTimeFormatInfo(temp); if (formatInfo == null) { columns[2].FullValue = temp; return(clogLine); } int endPos = formatInfo.DateTimeFormat.Length; int timeLen = formatInfo.TimeFormat.Length; int dateLen = formatInfo.DateFormat.Length; try { if (this.timeOffset != 0) { if (formatInfo.IgnoreFirstChar) { // First character is a bracket and should be ignored DateTime dateTime = DateTime.ParseExact(temp.Substring(1, endPos), formatInfo.DateTimeFormat, formatInfo.CultureInfo); dateTime = dateTime.Add(new TimeSpan(0, 0, 0, 0, this.timeOffset)); string newDate = dateTime.ToString(formatInfo.DateTimeFormat, formatInfo.CultureInfo); columns[0].FullValue = newDate.Substring(0, dateLen); // date columns[1].FullValue = newDate.Substring(dateLen + 1, timeLen); // time columns[2].FullValue = temp.Substring(endPos + 2); // rest of line } else { DateTime dateTime = DateTime.ParseExact(temp.Substring(0, endPos), formatInfo.DateTimeFormat, formatInfo.CultureInfo); dateTime = dateTime.Add(new TimeSpan(0, 0, 0, 0, this.timeOffset)); string newDate = dateTime.ToString(formatInfo.DateTimeFormat, formatInfo.CultureInfo); columns[0].FullValue = newDate.Substring(0, dateLen); // date columns[1].FullValue = newDate.Substring(dateLen + 1, timeLen); // time columns[2].FullValue = temp.Substring(endPos); // rest of line } } else { if (formatInfo.IgnoreFirstChar) { // First character is a bracket and should be ignored columns[0].FullValue = temp.Substring(1, dateLen); // date columns[1].FullValue = temp.Substring(dateLen + 2, timeLen); // time columns[2].FullValue = temp.Substring(endPos + 2); // rest of line } else { columns[0].FullValue = temp.Substring(0, dateLen); // date columns[1].FullValue = temp.Substring(dateLen + 1, timeLen); // time columns[2].FullValue = temp.Substring(endPos); // rest of line } } } catch (Exception) { columns[0].FullValue = "n/a"; columns[1].FullValue = "n/a"; columns[2].FullValue = temp; } return(clogLine); }