我有一个类似于下面的日志文件,我想将此日志文件转换为 excel 表。
样本日志文件
DateTime: 2012-12-10 20:27:10
Command: ALTER INDEX [Mypageviews] ON [WhosOff].[dbo].[PageViews] REORGANIZE WITH (LOB_COMPACTION = ON)
Comment: ObjectType: Table, IndexType: NonClustered, ImageText: N/A, NewLOB: No, FileStream: N/A, AllowPageLocks: Yes, PageCount: 7639, Fragmentation: 8.1817
Outcome: Succeeded
Duration: 00:00:41
DateTime: 2012-12-10 20:27:51
DateTime: 2012-12-10 20:27:52
Command: ALTER INDEX [MyVisitKeys] ON [WhosOff].[dbo].[Visit] REBUILD WITH (SORT_IN_TEMPDB = OFF, ONLINE = ON)
Comment: ObjectType: Table, IndexType: NonClustered, ImageText: N/A, NewLOB: No, FileStream: N/A, AllowPageLocks: Yes, PageCount: 7229, Fragmentation: 94.4667
Outcome: Succeeded
Duration: 00:00:06
DateTime: 2012-12-10 20:27:58
我希望使用 C# 将上述日志文本文件转换为 excel 表中的以下格式。输出
StartTime IndexName Dbnanme Tbname
2012-12-10 20:27:10 MyPageviews WhosOff PageViews
2012-12-10 20:27:52 MyVisitKeys WhoOff Visit
谁能告诉我如何编写程序来实现上述输出?