If I understand the use case correctly, you would like to return the samples from the .txt files having the same index.
This would also mean that you would increase the batch size by 10 (number of folders).
If that’s correct, you could use the index in your __getitem__ and load the correcponding .txt file using this index for all 10 folders.
Would that work or am I misunderstanding your use case?