Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change file name based on year and month of lates file

Status
Not open for further replies.

Cpreston

MIS
Mar 4, 2015
972
GB
Hi

I need to re-write a DTS package which finds the latest file based on the YYYY_MM at the end of the file name in a specific folder.

I want to find the latest file, our current one is called Sales_2019_02.csv . In the folder there is older files but always based on year and month.
The copy the file
Then rename the file to Sales_Current.csv but keep it in the same folder and overwrite the one that is there.

Could someone help me with this please I have been trying some google examples but none seem to work.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top