I get your point. My first mistake was not understanding the original poster's question - even after a few tries. My second mistake was replying whilst damn well knowing I cannot code very well yet.
I must say though that the question specified a file of 10.000 lines. If very much larger, or of unknown length, it would have been disadvisable.