Get The Value Using Regex

Hi,
I’m Attaching A screenshot from A Pdf.I want The “Total (INR)” Value Using Regex.
Please Help me.

Thanks
Total(INR)

can you send the pdf?

Hi

I Can’t @vishal.kp Because it Contains Client’s Data

Thanks

Or can you send the text part which only contains the total and amount after you read the pdf.

1 Like

@omprasad Try with this regex and let me know.

1 Like

Hi @indra
Thanks For Your Reply
I have two (INR).

Thanks

Thanks For Your Reply @vishal.kp @indra

I’m Getting The Values.

But I have so many pdf in a folder And the Structure is same.
How can i get all the same values from different pdfs.

I have Done

  1. Assign=Directory.Getfiles(“Filepath”)
  2. For Each Item In Files,Type Of Argument is String
  3. Start Process,FileName is Item

Thanks

hi @omprasad

Pass us the text that you are able to get, so we can suggest some common regex to you :slight_smile:

I usually test this out on https://regex101.com/

Do let us know in case of issue

Thanks For Your Reply @Shubham_Varshney

The Regex Is working For All Pdf But I have Similar Structure Of Pdf In a Folder.
I want to iterate Each Pdf And Get The Same Value.

I have Done

  1. Assign=Directory.Getfiles(“Filepath”)
  2. For Each Item In Files ,Type Of Argument is String
  3. Start Process, FileName is Item

What Is The Next Activity??
Thanks
demoPDf

Read PDF —> That will extract the whole PDF in text format :slight_smile:

Now the read format needs to apply the regex applied

Hi @omprasad,

The first thing I would like to know whether ‘Total(INR) 4,130.00’ is coming in single line or not.

If coming in single line and you want to get the whole line then please try the below -
Regex.Match(Your_String_Variable,"(?=Total\s*(\sINR\s)\s*)[\s*\w+\s*(),.]+).Trim

If coming in single line and you want to get the value only then please try the below -
Regex.Match(Your_String_Variable,"(?<=Total\s*(\sINR\s)\s*)[\s*\w+\s*(),.]+).Trim

Thanks & Regards,
Apurba

2 Likes

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