Saturday, June 28, 2014

Read the large text files into chunks line by line using c#

It's not clear why you are reading in chunks rather than, for example, using a StreamReader.ReadLine to get full lines. You could have an array (or list) of strings and read say 10 lines at a time then process them. But I don't know what the processing is intended to do - you don't say what you are trying to do.


If you read blocks then unless all lines are the same length you will have to deal with partial lines. Is that what fragment is supposed to handle? That's not clear from the code posted.




Regards David R

---------------------------------------------------------------

The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones.

Object-oriented programming offers a sustainable way to write spaghetti code. - Paul Graham.

Every program eventually becomes rococo, and then rubble. - Alan Perlis

The only valid measurement of code quality: WTFs/minute.


No comments:

Post a Comment