I have files which are labeled file1, file2, file3,... But to every file there are additional files which are called file1_1, file2_1, file2_2,...
Now, I want to iterate over all files in their corresponding order, so file1, file1_1, file2, file2_1, ...
import glob
for iter in range(number_of_files):
find_matching_files = glob.glob(file_directory + '\file' + str(iter+1) + "*")
The problem is that now file1 and file10 are listed in successive order. If I erase the "*" the additional files are excluded. Is there any smart way to do this?