You're doing
while(sr.ReadLine() != null)
That consumes a line, then you're doing
line = sr.ReadLine();
again, that consumes another line, but only the second read is stored in
sr
.
You could change it to this;
while ((line = sr.ReadLine()) != null)
{
if (line.Trim() != string.Empty)
{
s = line.substring(1,4) ;
}
}
Or maybe just use
FileInfo.ReadAllLines
unless your file is absolutely massive in size.
Hope this helps,
Fredrik