Hi together,
I get via OCR a string and seperate this. The result of thes was found in a array of course.
Now I need the array index, in which my search term is part of the string.
Example:
Dim>arExample,5
let>arrExample_1=/hck23
let>arrExample_2= good_KBS_perfekt
let>arrExample_3=Book17 Page5
let>arrExample_4=Greetings to you
ArrayFind,arrExample,*KBS*,nIndex,,_n doesn´t work
I need the index of the array field with the content "KBS".The position of "KBS" in the field was not fixed!
To realize this with nested loops seems to me possible, but not elegant.
Does anyone have another solution for this?
Thank you very much and best regards
Uwe
Arrayfind possible with wildcards?
Moderators: Dorian (MJT support), JRL
- Dorian (MJT support)
- Automation Wizard
- Posts: 1379
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Arrayfind possible with wildcards?
Firstly you have some errors in there. "Dim" should be "ArrayDim" and "ArrayFind," should be "ArrayFind>"
Once those are sorted - as per the manual - you can use Regex
Once those are sorted - as per the manual - you can use Regex
Code: Select all
Let>use_regex=1
ArrayDim>arExample,5
let>arrExample_1=/hck23
let>arrExample_2= good_KBS_perfekt
let>arrExample_3=Book17 Page5
let>arrExample_4=Greetings to you
ArrayFind>arrExample,KBS.*?,nIndex2,1
Yes, we have a Custom Scripting Service. Message me or go here
-
- Newbie
- Posts: 2
- Joined: Wed May 08, 2019 2:22 pm
Re: Arrayfind possible with wildcards?
Hi Dorian, thank you for the proposed solution.
Sorry for my typos in the example, I typed, no copy paste . You are right of course!
Your lines of code work perfectly, thanks!
I need to learn more about REGEX, because I didn't understand that part yet.
By this way, I would be happy in general if the code examples in the help function would increase
Many greetings and thanks again
Uwe
Sorry for my typos in the example, I typed, no copy paste . You are right of course!
Your lines of code work perfectly, thanks!
I need to learn more about REGEX, because I didn't understand that part yet.
By this way, I would be happy in general if the code examples in the help function would increase
Many greetings and thanks again
Uwe