I just need to know how to get the date from the file name and replace it with current date.
ABC 12-29-2022.xlsx (8.1 KB)
Here is the file name and I need to replace the date with current date.
Please can anyone Help??
Use copy file and then give the new name as below
Say the filename is in variable var1 then
System.text.regularexpressions.regex.Replace(var1,"\d{2}-\d{2}-\d{4}",Now.ToString("MM-dd-yyyy"))
Cheers
I just need an expression for using it in rename file
Because I am using rename file option for the same
I am trying but it is not working
It is not giving the desired output.
Also the file name I have provided is just an Example
Can you help me with the xaml please
Please check
Path.Combine(Path.GetDirectoryName(FileLocationWIthPath),System.Text.RegularExpressions.Regex.Replace(Path.GetFileName(FileLocationWIthPath),"\d{2}-d{2}-d{4}",Now.ToString("MM-dd-yyyy")))
Rename.xaml (6.1 KB)
cheers
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.