Get text from PDF span in two rows on the same cell

Am using a assign Activity. Does that mean i need to install the Regex package

Hi @RPA_Dev09

Yes
Bcz it gives you the UI for setting the flag as i have shown above.

So for that use the activity “Matches”.

Hope this may help to solve your issue
Mark as solution if this helps you and like it :innocent:

Happy Automation :raised_hands:

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

Ok Thanks. Which package did you install as am getting errors on System.Text.RegularExpressions.Regex by Microsoft

Thanks in advance.

Hi @RPA_Dev09

UiPath.Core.Activities.Matches

Hope this may help to solve your issue
Mark as solution if this helps you and like it :innocent:

Happy Automation :raised_hands:

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

Thanks @Pratik_Wavhal how ever am not getting the correct results. Please share the sequence you used to test on your side using the example pdf screenshot

@RPA_Dev09 Share the extracted example string and output you are expecting from that example string

Please create your topic for this…


I can’t share the exact PDF company policy. But the screenshot attached is similar to the PDF am reading. Am using Read PDF text activity. I want to get “John Smith X System Developer”. But using System.Text.RegularExpressions.Regex.Match(DataFound,"(?<=Customer:).*(?=Company:)").value am only getting “John Smith X”. Hope the information provided is clear.

Thanks

“DataFound” being the output of the ReadPDFText activity.

Hi @RPA_Dev09

Actually you are working on Original PDF so you can preserve the format while reading PDF.
But in my case you shared the Img for that data. So working on it with OCR while screen scrapping the data wont be der in the same format as it is der in the img. The data gets scribbled and output comes in single line as i have shown you below.
image

So i myself have write the data in same format on the Regex editor as it is der in img which you shared and then applied the regex on it. So then it work for me that i have already showed you in earlier posts.

In that way i showed you the output that work wid me. If I have the PDF then only i can make workflow.
Hope you got it what i am saying.

Happy Automation :raised_hands:

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

Hi @Pratik_Wavhal

I got what you said. i have recreated the PDF file that is similar to what am working with. I tested it, still get the same results as mentioned before. Tried to upload the file but am restricted. Please use the google drive link to get the file.

Thanks in advance.

Your case may be easier to automate a pdf reader instead of reading it as text:

Hi @bcorrea

Which activity did you use for this?

This is data scraping.

Hi @RPA_Dev09

Atlast the wait is over. I have made one workflow which gives the below output same what you want. And from this i also learn many more things.

image

RPA_Dev.xaml (5.8 KB)

Hope this may help to solve your query
Definetly mark as solution & like it. :innocent:

Happy Automation :raised_hands:

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

1 Like

Hi @bcorrea,

Thank you for the feedback. The data scraping works only for a single PDF test data which am testing with. But when testing it with different PDF, of the the same structure it fails as i mentioned before that the information in the cell my not span into tow rows. I hope you understand what am trying to say.

Thanks

Hi @Pratik_Wavhal

This worked like a charm!!! :slightly_smiling_face: :slightly_smiling_face: Thank you for your assistance.

Regards
RPA_Dev09

Hi @RPA_Dev09

You are always welcome. I worked on it and also learnt many things while finding the solution for the same.

It also helps me to gain knowledge. Thanks to you too.

Happy Automation :raised_hands:

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

2 Likes

Hi @Pratik_Wavhal

Am glad you learned something new from the issue I had. I learned a lot from your solution :100: :100: :100: :handshake:.

Regard
RPA_Dev09

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