I have files in one directory and based on target date, I want to replace those files present in another directory. Basically I want to update the latest file from 1st directory folder to another. I have designed all the logic, I am just not able to write the output in the second directory.