Split Text Related Query

Shweta

Active Member
Hi,

Good Afternoon!

Can someone please advise me on below query:

I have a requirement, where I am reading an image's data using "Read Text with OCR", and storing it in a new data item of Text type.

Now, I need to check if numeric value after ":" is greater than zero or not.. So, how can I achieve this?
If it is greater than zero, then Bot will proceed with further steps else it will stop.

For example: The text is:
!!? Display Number of Entries. The Number of entries that match the specified criteria : 180


Thanks.
 

sivagelli

Well-Known Member
Hello-

Lets say you have the text (!!? Display Number of Entries. The Number of entries that match the specified criteria : 180 ) in Data Item called OCRText.

Use Calc stage with expression: Right([OCRText], Len([OCRText]) - Instr([OCRText],":"))

The result will be 180.

Explanation:
Instr(): finds the position of the delimiter ":"
Len(): Finds teh total length of the string

Above, i used Len()-Instr() to get the number of characters to capture.

Right(): Gets the right side characters in the text.
 

rsingh40

Member
Hi,

Please try this

Business Object:- Utility String
Action:- Split Text

Inputs
Text to Split:- your Data item
Split Char:- ":"

Output
Split Values as a collection
-------------------------------
Business Object:- Utility Collection Manipulation
Action:- Read collection fields

Inputs
Row Index:- 1
Collection:- [Split Values] collection from above output
Field Name:- "Column1" is the collection column from Split value collection

Output
Value Read - this is of Text datatype
-----------------------------------
Use Calculation stage to convert Value Read to number datatype

ToNumber([Value Read])

---------------------------
use decision stage to check if the number is greater than 0
 

Shweta

Active Member
Hi,

I tried both the solutions, but not seeing any of them resulting into the solution that I am looking for.

1. Right([OCRText], Len([OCRText]) - Instr([OCRText],":"))
I gave this in Calc stage, but it did not return anything.

2. In second solution, it throws error: The Row index falls out of range.

Thanks.
 
Top