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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top