hi,
i have one file name is–MNR_MPK Foods India Private Limit_ 1st to 4th Dec’ 2021.
from this i want to get Date
From --01-12-2021
TO --04-12-2021
how to get date like ?
hi,
i have one file name is–MNR_MPK Foods India Private Limit_ 1st to 4th Dec’ 2021.
from this i want to get Date
From --01-12-2021
TO --04-12-2021
how to get date like ?
Use Assign activity
LHS → Create an variable
RHS → System.Text.RegularExpressions.Regex.Match("InputString","(?<=From\s--)(\d.{2}\d.{2}\d{4})").Tostring
Use Assign activity
LHS → Create an variable
RHS → System.Text.RegularExpressions.Regex.Match("InputString","(?<=TO\s--)(\d.{2}\d.{2}\d{4})").Tostring
Regards
Gokul
Hi @Anand_Designer ,
We could make use of Regex to get the Date values, but we would also need a Confirmation about the Date format.
Will the Date be always in this format ?
Using Regex we can get the First Date and the Complete date format like below :
(\d+)\w{2}\sto\s(.*\d)
Use Assign activity
LHS → Create an variable
RHS →
System.Text.RegularExpressions.Regex.Match("MNR_MPK Foods India Private Limit_ 1st to 4th Dec’ 2021","(?<=to\s)(\d.{3}\w{3}’\s\d{4})").Tostring
Regards
Gokul
yes the date format come like same above file name, it will change on weekly base Date.
like 5th to 11th Dec’2021
Regex should be the best approach but if you are not comfortable using it you can try to save the file name in a string variable and then do some string manipulation.
How to manipulate a part of string: Split, Trim, Substring, Replace, Remove, Left, Right - News / Tutorials - UiPath Community Forum