From what I understand, these files can be large. I also see that you're essentially reading the whole file into memory. The combination of those two could be bad. Before I propose a better solution, is it okay to put adjacent lines in different files? That is, let's say that I have a file that contains the following:
AAA
BBB
CCC
DDD
EEE
FFF
Is it okay to split into two files like so:
AAA
CCC
EEE
---
BBB
DDD
FFF
If so, I may have a really slick solution floating in my head...
thor
The only easy day was yesterday