Compare two Pdf/Word files

Hi all, May I know, if we can use Python code in Uipath in order to get required result??

Yes we can use python in UiPath. Can you elaborate your question @Rajnish?

1 Like

@HareeshMR Thank you for your response…I am trying to compare two pdf/word files and find out the unmatched data with line number and page number…I am able to get unmatched data but 60-80% only…I need to get 100% accuracy…I have found some library and code to get 100% accuracy in Python…so trying to get the information how to use those code in Uipath in order to get 100% accuracy…

Are you reading the pdf using OCR? @Rajnish

can you explain how you are doing that? I mean how you are confirming it as 60 -80 accuracy?

1 Like

@HareeshMR I am using “Read Pdf Text” activity…and when I compare two files in output panel it shows unmatched data and mixed data both…I am attaching .xaml file for your reference…PdfCompareNew.xaml (13.3 KB) pdfcompareNew1.xaml (16.1 KB) pdf-sample.pdf (7.8 KB) pdf-sample1.pdf (90.4 KB) Rajnish.xaml (14.3 KB)

This is quite confusing @Rajnish

Can you let me know which workflow I have to check from the above attached files please :slight_smile:?

@HareeshMR sorry for making it complicated …You can use PdfCompareNew.xaml (13.3 KB)

The workflow is exactly fine and it should work for sure @Rajnish
Two things you need to do is

  1. You are writing the data to text file in the else condition right? In that, you are always trying to write the new line or text to it, So you can’t find what data you are missing. Instead create a new string and append the data each time and write it to the file after the loop exists

  2. You are using the condition as out_str1_array(counter).trim=out_str2_array(counter).trim

Instead of this, try using out_str1_array(counter).trim.Equals(out_str2_array(counter).trim)

Please let me know if this works

1 Like

Thank you…I will try and let you know.