Oceas Anderson wrote:Thank you, and that did work.
No. Get rid of the for loop. The first time in the for loop, the while loop will ensure that the whole file is read. The next 9999 through the for loop will then just confirm that there is nothing left to read from the file.
If the file may be bigger than 10000 lines and you only want to read the first 10000, then you need to modify your while loop to inclde that check - your code at the moment doesn't do that.