File moving

C:\Users\admin\Desktop+“Now.ToString”.
i have to move file from one folder to another by using move file and need to add current time
but i should include file name also like test1 19-11-2021like this but the file name will be changing always.

hI @Gayathri_Mk

You can use For each file in folder Activity and use move file

image

  • You can use Current file for dynamic file name

Regards
Sudharsan

Are you able to move the file?

if yes. you can use string concatenation to set the name to the file dynamically. just pass the data inside the variable

Regards,
NaNi

Be carefull with string concatenation of folders + files, you’ll have to consider dirty input with the \ in between file and folder:

assign myFullPath = "c:\temp\" + "myFile" will be correct
assign myFullPath = "c:\temp" + "myFile" will not be correct, your missing the \

A proper solution for this is:
assign myFullPath = path.combine(folderName, Filename).toString will always work. The path.combine is ‘intelligent’ enough to determine if a \ needs to be added or not.

Hi @Gayathri_Mk

I think you need to move file and Rename

Use For each to iterate the list of files from directory

Directory.GetFiles(“YourFolderpath”)

Use assign Path.GetFilenameWithoutExtension(item)+" "+Now.Tostring(“dd-MM-yyyy”)+“YourFilenameExtesion”

use move file activity

Source =Item
Destination="YourOutpath"+assignVariable

Refer the screen shot below!

Regards

thank you

1 Like

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