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”
ppr
(Peter Preuss)
November 16, 2022, 7:45pm
3
we can extract it e.g. with regex:
strNo = System.Text.RegularExpressions.Regex.Match(YourStringVar,"\d+").Value
This CheatSheet introduces the basic use of regex functions. With further examples also special cases are presented.
Introduction
From the namespace System.Text.RegularExpressions following methods are offered:
Regex.Match
Regex.Matches
Regex.isMatch
Regex.Replace
Regex.Split
A simple usage for example would look like this:
[grafik]
Recommendation:
add System.Text.RegularExpressions to the imports:
[grafik]
it allows to use the shortened statement, as the namespace part can be ommited…
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
ppr
(Peter Preuss)
November 16, 2022, 9:08pm
6
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.
ppr
(Peter Preuss)
November 16, 2022, 9:49pm
8
Sisay_Dinku:
That has worked for me.
Perfect so let’s get the topic close by:
Forum FAQ - How to mark a post as a solution
This document is part of our beginners guide .
This article will teach you how to properly mark a post as a solution.
We were closely following our last UiPath Forum feedback round! topic and carefully extracted all the bits of feedback that was provided. As such, we would like to tackle the topic of solutions on our Forum and how to properly use them.
When is the topic resolved?
The topic can be considered resolved when the topic author has fo…
system
(system)
Closed
November 19, 2022, 9:50pm
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.