Is it possible to check the occurence of words in text extracted from "Get Visible OCR Text"?

Dears,

Is it possible to check the occurence of words in text extracted from “Get Visible OCR Text” ? Thanks in Advance

Note : I find the following subject but didn’t help: Count Occurrence of word in OCR string

1 Like

Of course if we get the output from get OCR text as a string variable so using if condition with contains method we can check the occurrence of the text in the output

1 Like

Hello Palaniyappan, I want to use RegX in my case, possible to expalain how to use it? seems very useful :slight_smile:

In fact my concern is to check the extracted text , if the last row contains “Key Word”

1 Like

Fine
Hope this expression would help you
System.Text.RegularExpressions.Regex.IsMatch(yourvariable,”Key Word”).ToString

This will give us output whether it’s true or false like the keyword is there or not

Cheers @hsendel

yourvariable represents “extractedData”?

1 Like

Yes
Exactly
@hsendel

1 Like

Or we can check with this expression either

If that doesn’t end with text rather just be there in the last line of the text then
This expression would help you

If the text is stored in str_input
Then

str_output = str_input.Split(Environment.Newline.ToArray()).last.ToString.Contains(“your keyword”).ToString

Cheers @hsendel

1 Like

Kindly let know for any queries or clarification
Cheers @hsendel

1 Like

I’m updating the file…I will let you know. Thx

1 Like

Great
Cheers @hsendel

I tried both Methodes and didn’t work. Could you please help?CheckIfLastLineContainsWord.xaml (6.7 KB) Example.zip (384 Bytes)

Any update Palaniyappan ?

let me check once pls
Cheers @hsendel

Problem Solved with : Regex.IsMatch : How to check if last line of text file contains one word?

Great
Cheers @hsendel

1 Like