I have a root folder that has a structure as
root
A
|-30
|-a.txt
|-b.txt
|-90
|-a.txt
|-b.txt
B
|-60
|-a.txt
|-b.txt
C
|-200
|-a.txt
|-b.txt
|-300
|-a.txt
|-b.txt
I want to find all subfolders (A,B,C,D) such that the subfolder of the subfolder (likes 30,90,...) smaller than 60. Then copy all file with the name is a.txt
in the subfolder to another directory. and the output likes
root_filter
A
|-30
|-a.txt
B
|-60
|-a.txt
I am using python but I cannot obtain the result
dataroot = './root'
for dir, dirs, files in os.walk(dataroot):
print (dir,os.path.isdir(dir))