change
Code:
while ((line = mStreamReader.ReadLine()) != null)
{
SplitLine(line);
ConvertToLong();
}
into
Code:
while ((line = mStreamReader.ReadLine()) != null)
{
if (string.IsNullOrEmpty(line))
break;
SplitLine(line);
ConvertToLong();
}
But this will also break the operation if there is an blank line in the middle of the file. You could also ignore blank lines
Code:
while ((line = mStreamReader.ReadLine()) != null)
{
if (!string.IsNullOrEmpty(line)) //only execute if line is not empty
{
SplitLine(line);
ConvertToLong();
}
}
Bookmarks