I have 100 of folder where in each folder I have another folder with same name and inside that folder there is a .txt file which I want to extract and merge all the txt files into a new folder.
Please help me with a script in python
Go to the root folder of 100 sub folders and find all of the .txt files, copy them into the new folder ~/tests:
find ./ -type f -name "*.txt" -exec cp "{}" ~/tests/ \;