How do I copy files inside a directory using python.All my AB.jpg should be copied to one folder and BC.jpg files to one more folder of by sub scripting the file with it's date from the file path). My path's created are dynamic based on the timestamps.
My local directory paths are in the below format:
directory : /tmp/hash/inputsrc/20201229/....../AB.jpg
/tmp/hash/inputsrc/20201228/....../BC.jpg
/tmp/hash/inputsrc/20201229/....../AB.jpg
/tmp/hash/inputsrc/20201228/....../BC.jpg
Expected output:
/newfolder/AB_20201229.jpg
/newfolder/AB_20201228.jpg
/newfolder/BC_20201229.jpg
/newfolder/BC_20201228.jpg