util to loop through files from multiple generators and/or multiple times