How to move specific file from one folder to another

Hi all,

I have downloaded two sheets i.e,
1.7166a12c-4d74-4073-87a4-321b63d7758a-canada.csv
2.7166a12c-4d74-4073-87a4-321b63d7758a-united_states.csv
I need to move the files to another folder. The problem here is, whenever I download the file, the name of the downloaded file will be changed. So I need to change the files with respect to names. How can I move the files?
Someone help me in solving this.

3 Likes

Hi @Anveshs

You can use the movefiles activities in uipath.

cheers :smiley:

Happy learning :smiley:

2 Likes

Hi @Anveshs

Put the path of your source and also the destination path.

cheers :smiley:

Happy learning :smiley:

3 Likes

Fine
hope these steps would helpyou resolve thiis
–use a assign activity like this
arr_filepath = Directory.GetFiles(“yourfolderpath”,“*.csv”)
where arr_filepath is a variable of type array of string
–now use a FOR EACH activity and pass the above variable as input and change the type argument as string in the property panel of for each loop
–inside the loop use a MOVE FILE activity where in the path property mention as item.tostring
and in the destination mention the path as
“yourfolderpath\”+Path.GetFilenamewithoutextension(item.tostring)+“yournewname”+“.csv”

Cheers @Anveshs

8 Likes

Hi @pattyricarte

I need to movey files with “.csv” extension only. So how can I do it?
Could you please provide me the solution for it.

1 Like

did these steps help you out
Cheers @Anveshs

2 Likes

@Anveshs

Scenario
1.Use Assignactivity and set the variable to String of array.
2.Use foreach to iterate with in the files in the folder.
3.Then create string variable for the input properties in the movefile
4.Then Create string variable for the destination and new name of the file.

See image below for your reference.

Also, you can use the thoughts of @Palaniyappan for your reference.

cheers :smiley:

Happy learning :smiley:

4 Likes

@Anveshs,

Please find the attached sample work flow.

Please like and mark it as resolved … If your requirement met.

Thanks,
AnilMoveFiles.zip (22.4 KB)

5 Likes

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