How to Rename file by insert date to new name

Hi All,

please help to guide acctivity for insert date to new rename
and move to new destination folder

exist get file : TIV*.pdf
Format date : “ddmmyyyy-”
source folder : Rename
Destination folder : New Name

Problems :

  1. I try it result neme file “TIVOP972360.pdf11052022-” (want to Date-Filename.pdf)
  2. I want to move to destination folder New Name but File still write to folder Rename

Thanks for guide i so newbie

Rename

try using the below method in the TO field of move activity

oldName.replace(oldName.split(" Provide back slash"c).Last.tostring,DateTime.Today.Tostring(“ddMMyyyy”)+".pdf).Tostring

Hi,

Can you try as the following?

System.IO.Path.Combine(distFolder,DateTime.Today.ToString("ddMMyyyy-")+System.IO.Path.GetFileName(oldName))

Regards,

@muhamed.fasil Thanks for the guide,
Please help to check my mistake

@Yoichi it’s Work, Thank for solution

I edite variable distFolder to strPathTo for my Project

System.IO.Path.Combine(distFolder,DateTime.Today.ToString(“ddMMyyyy-”)+System.IO.Path.GetFileName(oldName))

System.IO.Path.Combine(strPathTo,DateTime.Today.ToString(“ddMMyyyy-”)+System.IO.Path.GetFileName(oldName))

1 Like

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