This is my latest file(OrderMgmtZoneUsageChargesvDGResults8) and I want to replace with the old file (OrderMgmtZoneUsageChargesvDGResults54) in the folder .
Move File activity is used to move file from one folder to another folder.
Before doing moving file use the delete file activity to delete the old file.
In your case the last digit only changing then you can use the wild cards when giving the file path and file name in the delete file activity.
Note - In Move file activity, If you check the overwrite option if there is any file with the same, it overwrite the file
You can get the latest downloaded file by using this expression if the file has a dynamic name and you know the type of file :
Ex:I am getting the latest “.xlsx” file
str_filepath = Directory.GetFiles(folder_path,“*.xlsx”).OrderByDescending(Function(d) New FileInfo(d).CreationTime).Tolist(0)
And use move file activity by passing the str_filepath variable and check true for the overwrite box to overwrite the file if already exists in the destination.