Unable to extarct date from pdf

I am learning uipath through foundation course and want to complete this assignment.

i have created the xaml file but it is not working.
attaching the same.
what is going wrong

attching the xaml file as well
PDF_Extraction_assignment.xaml (9.9 KB)

1 Like

Hi @Abhinavpandey

Please send pdf file also I will check and let you know.

Kommi Jeevan.

Kindlly use Start Process activity with the file path of pdf as input file path before this attach window activity…
when we are using anchor base activity we need to the pdf file to be opened

CHeers @Abhinavpandey

Session_10_exercise_1_NPO_1_perfect_match.pdf (95.7 KB)

Attaching pdf

Hi @Palaniyappan

done that
added start process activity with full path of pdf in it

still getting wrong output

PDF_Extraction_assignment.xaml (10.3 KB)

here you go
pdf.zip (90.8 KB)

Cheers @Abhinavpandey

Thanks @Palaniyappan

Its working.

2 question

1 : what is wrong with the method i tried to implement

  1. : can you explain this how you are extracting

Split(str_output.ToString.Substring(str_output.IndexOf("DATE “),15).ToString,” ").Last.ToString

through google ocr whole pdf file content we have…
now in write line activity what you did exactly

1 Like

when i tried with anchor base i was facing some issue with getting text
i wondered why that happened
so i went for another method, like reading pdf and string manipulation
thats how that expression came up
your method was right , but i found pdf was not set opened before fetching the data and that was only one i felt missing in yours
else it was fine
Cheers @Abhinavpandey

i opend the pdf in updated xaml file using start process.


can you explain this expresssion "Split(str_output.ToString.Substring(str_output.IndexOf("DATE “),15).ToString,” “).Last.ToString”

this substring method gave me Date | 6/6/2019
so to get the last date value alone, used split method with space as delimiter and obtained the last splitted value alone
Cheers @Abhinavpandey

1 Like


1 Like

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