Error on Extracting pdf data

Hi, i want to get “To:” data address from invoice pdf as i
given below (System.Text.RegularExpressions.Regex.Match(txt,“(?<=To:).+”).ToString.Trim) this line of code is working for getting data from next element but i want to get data from down of “To:” address, so can you edit this code and given me the code

@Palaniyappan @Shweta1717 @Sidney_Vogel

Note: i tried scrapping, but i want get data dynamically

@gokul_t Hi, scraping could also work dinamicly since the PDF file invoice is the same format for that invoice, so the location of “To” will never change, You can use Get OCR Text and store it in a variable and use it as you wish or format it the way you want, that is how i have done it. so its one way of doing it, just sharing my thoughts.

I am doing for multiple format of invoice, so address size is getting varied @Sidney_Vogel

Hi @gokul_t,

Are you got the solution? Its Scanned PDF or protected PDF? if you share the PDF & I will check from my side.

@Sidney_Vogel Hi, can you check the pdf invoice i have given below wordpress.pdf (42.6 KB)

Hey @gokul_t,
Step 1: Read PDF Text Activity, Please refer to the Screenshot.
image
Step 2 : Matches Activity → Input Parameter → 1.WordString(output from Read PDF Text activity) & Pattern as To:.\n..\n..\n..\n..\n.*. & Please refer the screenshot given below

System.Text.RegularExpressions.Regex.Match(txt,“(?<=To:.\n..\n..\n..\n..\n.*.).+”).ToString.Trim this Expression not working can you suggest me any other @Vivek.A.S

Hi @gokul_t,

Use abby Ocr or CV to get the data & use this regex “(?sim)(?<=To:)(.*)”

HI @varunk I used this code System.Text.RegularExpressions.Regex.Match(txt,“(?sim)(?<=To:)(.*)”).ToString.Trim i am getting total text but i given “To:” has i attached my screenshot and attachment my project can please check it

InvoiceDemo.zip (67.5 KB)

HI @varunk I used this code System.Text.RegularExpressions.Regex.Match(txt,“(?sim)(?<=To:)(.*)”).ToString.Trim i am getting total text but i given “To:” has i attached my screenshot and attachment my project can please check itSequence.xaml (8.9 KB)

Hey @gokul_t, Am Getting the output & Change the Pattern → Please refer the screenshot given below
image

Hi @Vivek.A.S Can you say how to print matching value, I have sent screenshot and project below Sequence.xaml (7.5 KB)

Hey @gokul_t,Refer the screenshot

Hey @gokul_t,Refer the screenshot
image

Hi @Vivek.A.S matching result should be saved in string or any variable

Use Assign Activity , you Can assign to New_Variable as String
New_variable = WP_TO_ADD(0).value

Hi @Vivek.A.S i have created variable as string i am getting error as i given below

Sequence.xaml (8.1 KB)

Check out this xaml File → Sequence.xaml (8.1 KB)

Hi @Vivek.A.S, Thank you its working fine, but if i try for same logic for “From:” its not working

Please check out this xaml for From Address & To Address → Sequence.xaml (9.8 KB) and then mark it as Solution.