Rename dynamic filename from a folder in a static one

Hi all,

any idea how to rename a file from a folder like this:
initial name: name_file_118615241345157.xls
final name: name_file.xls?
the initial name is dynamic, daily is different so simple move activity doesn’t work, because i need to use *
consider that in that folder can be also other files, but not containing name_file in their names.

Thanks,
Cosmin

If MyFileName is string “name_file_118615241345157.xls”, you can save the file to System.Text.RegularExpressions.Regex.Replace(MyFileName, "_\d+", String.Empty).

Please can you help me with a xaml? if i don’t ask for too much
i’m a little stucked
Thanks a lot!
Cosmin

the initial name which i have in reality is

monitor_export_name-or-name-name_20190330_20200428-10.xls
and basically i need to obtain
monitor_export_name
a static name
how is posible?

thanks
Cosmin

In that case, use this one:

System.Text.RegularExpressions.Regex.Replace(MyFileName, “((_|-)\d+)+”, String.Empty).

1 Like

brilliant!!!
very very helpful
i tried all day to solve this; now i have a full process.

Thanks a lot!
Cosmin

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