Get values after specific text


I would like to ask for an advice. I need to extract data from a text. I have to get Sub total, GST and Total as variables from a text that looks like this:


I tried splitting the text, RegEx activities…but I am still not getting anything useful. Can someone help?

Thank you very much


Is the format same for every file?
If so then can you share the text so we can apply the regex

yes, all files have this kind of format

Can you share the text for applying regex

You can use the following regex patterns.

(?<=Sub Total )\d+[.]\d+ for Sub Total
(?<=GST \d\d% )\d+[.]\d+|(?<=GST \d% )\d+[.]\d+ for GST
(?<=Total )\d+[.]\d+ for total

A grouped regex will look like below

((?<=Sub Total )\d+[.]\d+)|((?<=GST \d\d% )\d+[.]\d+|(?<=GST \d% )\d+[.]\d+)|((?<=Total )\d+[.]\d+)

1 Like


If you want to learn Regex - check out my Megapost

Thank you very much…can you just help me with the formula? I can assign the variable Sub Total to regex expression using Match or another?

Why don’t you try using anchor base activity?

I tried to use anchor and get text activity but it works always only for the first pdf file and the element cannot be found in the next…

Maybe beacuse it’s attached to a specific pdf url.
Try to move ther action out of the seqence, if it makes sense
Else try to make the pdf url dynamic,… Does it help? :slight_smile:

Not really, it is not connected to any URL…

Will you send me a screenshot, unless the problem is solved? :slight_smile:

My task is to get the sub Total, GTS and Total data from several pdf files, however, they ar eat the end of the document:

I used start process to be able to open the pdf:

But using Get Text and Anchor base activity is still working just for first file, in other UI element cannot be found. I edited the selector by *.pdf…but is still not dynamic enough