Read PDF text and get the second occurrence

I hope you can help me.

In a PDF sheet I have two totals both are called “Total”.
How can I read both totals?

I am using the Read PDF Text activity.

To read the first match use: ReadPDF.Substring(ReadPDF.IndexOf(“Total”)+“Total”.Length).Split(Environment.NewLine.ToCharArray)(0)

But I can’t find the following match.
I have tried to use lastIndexOf but it reads “Total end” another data from the PDF.

Hi @Angie_Oviedo

Take a look here:

is there character common after totals you wanted to extract?

@Angie_Oviedo

Can you share the pdf.

I Think You are Finding Something Like This
Regex to Match Total Value

Use Matches Activity for Regex To Get Total Value,
And pass Read PDF Text activity output variable as an input of Matches activity.

To get second occurence of Total Value use This Expression
MatchList(1)

Hope it Helps.

Let me Know if you have any queries.

Regards,
Saloni

Hello @Angie_Oviedo

Mark it as Solution if it is working Fine.
So we can close the Topic.

Regards,
Saloni

Thanks for your help.
I have hardly used RegEx but it is a very good option.

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