Change path and edit name (save file)

Hello.

I want to edit name filename
original : TIV_xxxxxx.pdf (location : Desktop)
expect result : TIV_xxxxxx_datetoday.pdf (location : C:\Data\Input)

Please guide me for solve it.
Thank you.

@Stef_99,

Try this approach

Use assign activity to prepare the destination file name and path

SourcePath = "C:\Users\YourUsername\Desktop\TIV_xxxxxx.pdf"
NewFileName = Path.GetFileNameWithoutExtension(SourcePath) + "_" + DateTime.Now.ToString("ddMMyyyy") + Path.GetExtension(SourcePath)
DestinationPath = "C:\Data\Input\" + NewFileName

Use move file activity and pass Soruce and Destination these two variables

++Made extention dynamic so it will work with any file extention.

How to get sourcepath and original filename ?
bacause location file have sometime change.

@Stef_99,

That you can get with For Each File in Folder activity but remember the file name should be fixed or should have some logic to identify that it’s your desired file

1 Like

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