我有一个文本文件,其中包含这样的数据输入数据文件类型:INdia.Txt
INdia(s) - Input Data File Exists .....
**------------------------------------------**
Feed Counts:
**------------------------------------------**
Records in the Input File : 04686
Records Inserted in Table : 04069
Records Inserted in Table : 00617
**-------------------------------------------**
我只需要在输出文件中获取这些数据
Records in the Input File : 04686
Records Inserted in Table : 04069
Records Inserted in Table : 00617
我正在使用的代码
try
{
int NumberOfLines = 15;
string[] ListLines = new string[NumberOfLines];
using (FileStream fs = new FileStream(@"d:\Tesco\NGC\UtilityLogs\Store.log", FileMode.Open))
{
using (StreamReader reader = new StreamReader(fs, Encoding.UTF8))
{
string line = null;
while ((line = reader.ReadLine()) != null)
{
Console.WriteLine(line);
if (line.Contains("Records"))
{
//Read the number of lines and put them in the array
for (int i = 8; i < NumberOfLines; i++)
{
ListLines[i] = reader.ReadLine();
}
}
}
}
}
}
catch (Exception ex)
{
throw ex;
}