How can I move a file and include the version of that file in the name, if it already exists with the same name?

I’m using an excel file to find the names of some folders and rename the files in these folders according to the codes that are in this spreadsheet.

I want to rename the files inside the folder and move to another folder. I would like to highlight the version of this file in the name.
Ex: File_(1), File_(2)…

And I would like to whenever I move a file and the same file already exists, check the version and add it as a new version without existing file conflict.

@vinicius.botelho - Please check this post…it might help you…

Hi @vinicius.botelho,

How about using path exists to check if file already exists or not.
If it does, fetch the name of the file, extract version number from the end(may be use substring), increment it by 1 and update it into the next filename.


Hi @sonaliaggarwal47, could you explain to me how to perform this activity?