Hi all.
I have a file path as below and need to get only the number 640419 . Can you help?
“C:\Users\Dany\Documents\UiPath\Generate Yearly Report for Vendor\Data\Temp\Invoice-640419 .pdf”
@Dinesh_Babu_S
Use Regex :- \d+
This will give you only numeric
activity name : IsMatch in UiPath
Hi @Dinesh_Babu_S,
Please use a split operation, where, you read the file name in a string.
Str = “C:\Users\Dany\Documents\UiPath\Generate Yearly Report for Vendor\Data\Temp\Invoice-640419 .pdf”
Str= str.Split("-“c)(1).Split(”."c)(0)
This will give the second part of the split string.
Hi,
Another solution :
System.Text.RegularExpressions.Regex.Match(System.IO.Path.GetFileNameWithoutExtension(filepath),"\d+").Value
It’s no problem even parent directories have numeric character(s).
Regards,
Hi Lakshay.
I tried it but instead using match activity along with message box.
But the out put is as below.
Hi yoichi . Thank you.
It worked
Hi songoel . Thank you.
It worked
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.