How to use Regex to get particular text from a text file?

Hello all,

I am trying to get particular text from a pdf, i managed to get text from pdf by using Read PDF Text activity).pdftext.zip (1.1 KB) I figured that we can use regular expressions but i found it difficult.

Below is the text i am willing to take from pdftext file:
Origin
Ready Date
Destination
Delivery Date
Service Requested
Weight
Total

Kindly help me out.

Regards,
BP

1 Like

Hi @BXP

What lines of the file are these pieces of text?

Hello,

Below are the line numbers. i just pasted in notepad++ and counted the lines
Origin - 11
Ready Date-12
Destination-15
Delivery Date-17
Service Requested-19
Weight-21
Total-22

Regards,
BP

What exactly do you want to extract?

Edit nvm I figured it out, ill write some Regex to help you out

BXP.xaml (10.5 KB)

Here, just change the path to the file read not to your path.

If you don’t understand something please write me a message, and if you find this solution to work, mark it as a solution :slight_smile:

1 Like

Hello @srdjan.suc,

Thank you so much for you help, it worked out well. I used your logic and derived the required fields from pdf text file and i used assign activity instead of Is match activity, Please go through the solution.pdf.xaml (15.4 KB) and correct me if i am wrong.

Regards,
BP

1 Like

Well it looks fine, do you get the proper results?

I cannot check it whole because I need the PDFs, but you get the point :).

Also, mark this as a solution so people see it faster if they are searching for something similar

1 Like

Hi @BXP

Try these as your reference .

cheers :smiley:

Happy learning :smiley:

2 Likes

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