Renaming multiple files in a folder from String Array

Hi!

Is it possible to update file names(excel files) in a windows folder by fetching filenames from string array? Array is like this {“folder1”,“folder2”,“folder3”} I know that this might be possible to execute via “move” command too but in this case Array would be handy! :slight_smile:

yah thats possiible
–use a assign activity like this
arr_filepath = Directory.GetFies(“yourfolderpath”,“*.xlsx”)
where arr_filepath is a array variable
–now use a for each activity and passs the arr_filepath as input and change the type argument as string int he property panel
–inside the loop use a MOVE FILE activvity where in the path mention as item.ToString
and in the Destination property mention the file name you want like this
“yourfolderpath"+“yournew filename”+”.xlsx"

hope this would help you
Cheers @Mikko_S

1 Like

In my undesrtanding this method applies to case where you want to rename file with a single specific name. I´d like to update five excel files each with a different name. Like in previous message. First file would be folder1, second file folder 2 etc.

In the end i ended up using just string array and using index value to assign for move activity. Worked up ok too!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.