berkaykor
(David Lopez)
November 5, 2020, 12:17pm
1
Hey everyone,
I have a pdf which i convert it to text using Read PDF Text activity.
The output is like a long text so will only write the part I need:
… … … … …
… … … … … … … … … …
… … . . . … \r\nNumber CT1/4561355507 04.11.2020 1\r\n … …
… … … … … … … … … …
I need the “4561355507”, CT1 and the date after the number is not stable they change everytime. But the text “Number” is stable and the " / " before “4561355507” is also stable.
I need to assign “4561355507” to a variable.
Please Help,
Thank you,
ppr
(Peter Preuss)
November 5, 2020, 12:25pm
2
@berkaykor
Anchored on Number and /
(?<=Number )(.*)\/(\d+) (\d{2}.\d{2}.\d{4})
refering to the groups:
berkaykor
(David Lopez)
November 5, 2020, 12:38pm
3
How can I use this exactly, how can I assign these to variables
ptrobot
November 5, 2020, 12:39pm
4
If you only need “4561355507”, try this:
myNumber = System.Text.RegularExpressions.RegEx.Match(pdfText, "(?<=Number\s\w+/)\d+(?=\s\d{2}\.\d{2}\.\d{4})").Value
ppr
(Peter Preuss)
November 5, 2020, 12:39pm
5
@berkaykor
have a look here:
As an alternate to get only the number:
Let us know your further questions
berkaykor
(David Lopez)
November 5, 2020, 12:48pm
7
Thank you both @ppr & @ptrobot I just need the number
myNumber = System.Text.RegularExpressions.RegEx.Match(pdfText, "(?<=Number\s\w+/)\d+(?=\s\d{2}\.\d{2}\.\d{4})").Value
this one worked
1 Like
system
(system)
Closed
November 8, 2020, 12:48pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.