Find the text adjacent to a string and extract the value

I have extracted PDF text and saved it as string. I need to check if a specific word (say total amount ,Bill number etc…)is present in the PDF. If it is so,i need to extract the word adjacent to the specific word and add it to Data table. How can i achieve this functionality?

@Gopalakrishnan_K Use regex for this task.

@Vrushali_Gave, How to use regex in case i need to fetch the adjacent word in a string

Hi @Gopalakrishnan_K

Can you share the readed PDF text file along with PreserveFormatting option in properties as “True” and also without “True”

So that applying exact Regex on the same will be easier

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

@Pratik_Wavhal,
Amazon.pdf (60.2 KB)
In this pdf, i am searching for text ‘Order total’. If the text is present, i need to extract the word adjacent to ‘Order total’ which is the value corresponding to the field.

@Pratik_Wavhal,
please reply

Hi @Gopalakrishnan_K

Below is the workflow for the same :-

MainPratik.xaml (8.6 KB)
output.txt (1.3 KB)

Output :-

image

image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Thanks ,got it

If you want to learn more about Regex - check out my MegaPost.

Hi @Pratik_Wavhal , Even i am working on the same use case. Is it possible to obtain the same scenario for the field “Price” in the above pdf? Because the price amount is printed below the Price field. How to obtain that?

Hi @Anju_Unnikrishnan

So you mean to say the price der which is in below SS right down side ??

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

@Pratik_Wavhal, The Price which is present right to the “Items Ordered”. I want to extract the value (57,990.00) which is below the Price field.

Hi @Anju_Unnikrishnan

Below is the workflow which meets your requirement :-

Pratik.xaml (9.4 KB)

Output :-

image

image

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

@Pratik_Wavhal, Thank you

Hi @Anju_Unnikrishnan @Gopalakrishnan_K

You both are welcome :wink:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

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