I have a folder in which files are saved with the following filename: projectnumber_versionY.xlsx
Per project number, minimum 1 version is saved and maximum 3 versions. If version3 exists then i need to upload version 3 of that projectnumber, else version 2, else version 1. The uploading is not a problem, I am stuck at building the logic to assess which version to upload.
Thanks for your reply.
Could you give an example? Also, i’m still wondering how to determine that it should be done for each project number in that folder.
okay, you can try this.
Once you get all the files from the folder you will have a list of files
Now loop through each file (for-each) and extract the ‘projectnumber’ by using substring before _
Create a var initialize to 3 and then create a while (we are inside the first for-each) var = 1
now check if path.exists using the concat(“projectnumber_”, “var”, “.xlsx”)
if exist upload or it will loop through the rest and find the lower version
Like this for each projectnumber from 3 to 1 you will search and upload.
here is the solution you required it was developed using 2018.3 i don’t know which version you might be using I am attaching step by step code in excel. let me know if you need any more clarification. Main.xaml (10.9 KB) Main.xlsx (3.3 KB)
Thank you for getting me in the right direction @pathrudu, @nadim.warsi, @arivu96.
I’m not completely there yet, but by combining your input I think I’ll get there.