Update Reader.cs

This commit is contained in:
lastvoidtemplar
2021-07-13 22:16:01 +03:00
parent 078b701b79
commit 45c3a202ed

View File

@@ -31,15 +31,7 @@ namespace BoerseDataConvert
string s = reader.ReadLine();
if (reader.EndOfStream)
{
CheckFinalLine(s);
EndFile();
fileInd++;
stopwatch.Start();
reader = new StreamReader($@"{adr}/{filesNames[fileInd]}", CodePagesEncodingProvider.Instance.GetEncoding(1252));
RecordController.NextFile(filesNames[fileInd]);
string date = reader.ReadLine();
CheckFirstLine(date);
s = reader.ReadLine();
s = NextFile(s);
}
string[] sr = s.Split("|").ToArray();
Record record = new Record();
@@ -50,6 +42,19 @@ namespace BoerseDataConvert
}
return record;
}
private string NextFile(string s)
{
CheckFinalLine(s);
EndFile();
fileInd++;
stopwatch.Start();
reader = new StreamReader($@"{adr}/{filesNames[fileInd]}", CodePagesEncodingProvider.Instance.GetEncoding(1252));
RecordController.NextFile(filesNames[fileInd]);
string date = reader.ReadLine();
CheckFirstLine(date);
s = reader.ReadLine();
return s;
}
private void CheckFirstLine(string date)
{
try