madesjardins
MIS
Hi there,
Currently writing a script that, at some point, needs to read through a file which will have more than 50000 lines and sometimes 200K or more. I'm doing so with a while not feof, and then some fgets'.
If I don't put a yield in the while loop, pw5.exe takes up 100% cpu usage. If I do put yield in the loop, CPU usage stays pretty low, but the script slows down to a crawl, making reading those 50k-200k files tedious and unpractical.
Is there any other to go about handling big files in an efficient way?
Thanks.
Currently writing a script that, at some point, needs to read through a file which will have more than 50000 lines and sometimes 200K or more. I'm doing so with a while not feof, and then some fgets'.
If I don't put a yield in the while loop, pw5.exe takes up 100% cpu usage. If I do put yield in the loop, CPU usage stays pretty low, but the script slows down to a crawl, making reading those 50k-200k files tedious and unpractical.
Is there any other to go about handling big files in an efficient way?
Thanks.