If You know the list count then eg. 100 lines.
Make one main file, full with data MainKeys.txt
Then Make another list ActualKeys. txt.
Take lines from actual list one after another and delete it.
Check ActualList count in every run.
When count = 0 copy all data from MainKeys to ActualKeys for...