Find the matching keyword file from set of files - String comparison

Hi All, Iā€™m new to UIPath and currently doing some POC examples for learning. Could you please guide me on this.

  1. I have text file that generated using googleOCR. (textFile)
  2. I have set of text files that containing one or more Keywords(Comma separated).(keyWordTextFiles)

So I need to match the textFile with keyWordTextFiles and get the best matching keyWordTextFile

Its very helpful if you can guide me on this. :slight_smile:

Hi @Thilina_Rubasingha, You can follow below steps-

A. Exact Match

  1. Store keywords into an array
  2. Loop through the array
  3. Search keywords into the text file one by one using regex or string manipulation.

B. Partial Match

  1. Create your own puzzy algorithm.
1 Like

@vikaskulhari thank you very much for the reply, so in this keyWordTextFiles, may be contains the same key word/s in more than one file. for example.
File one - Apple, Mango, Banana, Pineapple
File two- Cat, Dog, Elephant, Ant, Bird
File Three - Banana, Rice, Potato, Carrot

OCR file - Apple Banana Ant and some other text.

As you see, for this perfect match is File One(it contains Apple and Banana ,Both)
In my case I need to get this perfect matching file.

@Thilina_Rubasingha, Yes you can get it. Refer the Bullet A from my previous comment.

@vikaskulhari I have added the keyWordTextFiles reading in to

Dictionary(String,List< String >)

,
Ex. Dictionary("File one.txt","{ "Apple", "Mango", "Banana" , "Pineapple"}")

When I adding to Dictionary, successfully add all files and keywords(I have used the same as above. 3 keyWordFiles). Print the details, All are fine.
But when I use the same dictionary in other part of the process(when comparing). It contains last inserted recode only. Try with containsKey() for missing keys and it says key is not in the dictionary.

Can you share the workflow and supporting files?