isabella423, this smells like an XY Problem. I would try an alternate solution, like (already suggested) using a while loop to read in lines one at a time, and pushing into your array only those lines you actually care about. You could also try using the tail program (available on Windows with cygwin).