So I am trying to create a console app to parse text files. I am using a streamreader to read the text in until I reach end of file. The text file I am reading as 22945 lines. Right now I am just trying to read the entire file and write it to another file. The new file ends at line 22926. Does any body have any idea why? Is there a limit to how much data I can read through a streamreader? The code I am using is this:

     line = fs.ReadLine();
5 Years
Discussion Span
Last Post by jt_murphree

If it's just text, it should not be a problem.
Are you running into any binary characters?

Would something like this also fail?:

File.WriteAllLines(@"c:\science\out.txt", File.ReadAllLines(@"c:\science\data.txt"));

Edited by thines01: added code


Actually I just discovered that it was not an issue with the stream that was reading but the one that was writeing. I was not flushing it. Now I have that issue solved. Still have a couple of others but I am not at the point of having to ask for help yet. I may be there soon tough!!!!!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.