Get OCR text and split it




I had to extract OCR text (using scrape relative).

somthing like:
“Name surname

i had splitted the extracted generic value to a string[]

extracting the Name surname is simple: text(0)
but the other fields are vaariable it may be 1 or two adresse.
how i can procedd to extract the whole adresse in one ?


Hi @abdel, can you clarify the problem? it is that you can get the names using an array, but you do not know how many are in the array as this can change each time?

If so you can get the length of an array by using Arr.length then you can use the length with to extract the data from the array, for example using a for each loop


Hi Djhi think that you got the point, but i think using the first lign as “name surname”, the last ligne of the array are the adresses one


So if, for instance, you always knew that the first line of the array is the name and the last line is the address but you don’t always know how many lines are in between, then you can assign your name as Arr(0) and the address as arr(arr.length-1)



If you want to extract all the address at a time , and if the array contains only name in first position and remaining elements are address then i think you can you use this.

Let us take you are having a string array arrABC


Now you will get all items in an array except first element as string seperated by comma(,)