Hi,
I have a UI element as such: “0kg (-0.03kg)”. I want to extract only the “-0.03” and have an if condition to compare if it is less than 1.
Can you help me please?
Thanks!
Hi,
I have a UI element as such: “0kg (-0.03kg)”. I want to extract only the “-0.03” and have an if condition to compare if it is less than 1.
Can you help me please?
Thanks!
After extraction of UI element
Use the below assign activitiy to extract the data
digit = System.Text.RegularExpressions.Regex.Match(input, "(?<=\().*(?=\))").value
Regards
Nived N
Happy Automation
@Yudhisteer_Chintaram1 You can use regex to collect the desired data
My element is assigned to a variable “text” like this:(for testing purpose only)
What is “input” in your code?
Thanks!
Hi @Yudhisteer_Chintaram1
as per your workflow, input is equal to text variable
Regards,
Nived N
Happy Automation
@Yudhisteer_Chintaram1 - could you please show us your regex assign statement? and your ‘Open’ variable type?
System.Text.RegularExpressions.Regex.Match(text, “(?<=().*(?=))”).value
As advised by @NIVED_NAMBIAR
Hi:
Try this entry:
output = System.Text.RegularExpressions.Regex.Match(your_String,"(?<=\().*(?=kg)").Value
as @Arpit_Kesharwani suggest you.
This expression returns the empty string…that’s why you are getting the empty ouptut…
Whenever there is () involved in the text you should escape it with \ or else it will not work…
Please check the below Regex pattern…
[-\d.]+(?=kg\))
Sorry , I typed correctly in forum but it appear in other way
Kindly check my response again
It is fine now
Thanks for the help:
Can you help me with this too please? They are related.
Thanks for the help.
Can you help me with this too please? They are related.
Hi,
Thanks for the help.
Can you help me with this too please?
They are related.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.