I have a list of directories with same structure/same file name. Under each there are files with different types and each directory has the same file names (number of files may vary) but different contents.
parentDIR-
- subDir1
- file1.ext1 (contains taskID)
- file2.ext2 (contains userID)
- file3.ext3
- subDir2
- file1.ext1 (contains taskID)
- file2.ext2 (contains userID)
- file3.ext3
- subDir100
How do I search all the directories and extract taskID and userID as a pair from file1/file2? I need the file1/file2 in the same directory to be opened/closed properly and read the contents because they have some information shared in common.
I am thinking to use
glob, with xxxx as, ExitStack(), but not sure how to connect them all together