Remove the Text and Get only the Six Digit Numbers

Hi

A little background. When I get data from my app for each iteration, the data appear text and numbers together as you can see in the following screenshot (Transaction Number: 679937). I need only the number (679937) and I have to take it to the Status report (Excel file under the column called Transaction number)

The transaction number has to be sent to the last column “Transaction Number”

we can extract it e.g. with regex:


strNo = System.Text.RegularExpressions.Regex.Match(YourStringVar,"\d+").Value

1 Like

@ppr thank you. Could you elaborate more please?

@ppr if you do not mind, can you break this down for me?
strNo = System.Text.RegularExpressions.Regex.Match(YourStringVar,“\d+”).Value
For example, what does “\d+” represent? from the above syntax? Also, I was trying to see from the list the data type of the Value or or query on the right side of the equality sign. Thank you for your help

grafik
taken from regex101.com

We attached the cheatsheet for regex and here you get also initial starter help

lets asume you have a variable with name: strText with the a value: “Transaction Number: 679937”

so extracting the number would look like this:

in case you need more general help checkout the courses from the UiPath Academy

For RnD and prototyping have also a look here:

@ppr, thanks a lot! That has worked for me. Thank you for the breakdown. That was helpful.

Perfect so let’s get the topic close by:

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