I'm wanting to walk through a directory and search for a specific folder (knowing the name=="bar") and then recursively process all files. Note,do not process the directory "notbar". I can't seem to get the logic for finding the specific directory I need and not include the other duplicate files.
Given a general base_path = r'C:\data\foo'
How do I find "bar" and recursively walk through to process files.dat?
C:\data\foo
- notbar
-123
-file1.dat
-456
-file2.dat
-file3.dat
- bar
-123
-file1.dat
-456
-file2.dat
-file3.dat