File IO Question

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

I am trying to read an old text file with blanks. I am wondering how do I
loop through each line even if its a blank? I cannot use the code below to
loop through the file. Also,some of these text files are delimited by a
space and not always delimited with carriage return. How can I make the
streamreader read it two lines instead of one?

while (line = sr.ReadLine() != null)
{
....
}

Thanks
 
Jack said:
I am trying to read an old text file with blanks. I am wondering how do I
loop through each line even if its a blank? I cannot use the code below to
loop through the file.

Why not? What happens if you try? It should work fine.
Also,some of these text files are delimited by a
space and not always delimited with carriage return. How can I make the
streamreader read it two lines instead of one?

Not sure what you mean by the last sentence - could you explain in more
detail?
 
Back
Top