String Manipulation with Split(item, " ")(1).ToString

Hello to everyone :slight_smile:

Looks like string manipulation sometimes can be very hard to handle.

This is my string

1.2. Nome Robert Negula
1.2. Endereço Rua do circuito do estoril N12DT
1.3 Telefone 916778495
1.4. N° ID Civil 302541244151551
1.5. N° ID Fiscal 2520145741444141

It is coming from a PDF file extracted with Tesseract.
The same thing as usual, putting the data into a variable, then assign it to a String array list variable.

Example:

It has to be something related to the manipulation because if I use a text box inside the for each loop I can see the data coming.

image

“I want to get only “Robert Negula” cutting “1.2. Nome” from the string”

Anyone can help?
Thank you a lot!

Hi. Can you emphasize what information you want to extract? And what is your goal?

Hi @Andre_Vieira ,

Which text you want exactly from 1.2. Nome Robert Negula ?

1 Like

Hello, I miss that part:

I want to get only “Robert Negula” cutting “1.2. Nome” from the string

try this
test.xaml (5.4 KB)

1 Like

Let me see bro!

Hi @Andre_Vieira
Use the regex condition like this: (?<=Nome\s)(\S.+)

Refer the screenshot
Regex

Try this and let me know

1 Like

But the Nome here is dynamic right?? So after 1.2 you would like to ignore the first string ? if yes, what are the other possibilities of getting the values other than Nome and what if 1.2 Nome ABCD Rober Negula, is this possible too?

It works!
But I’m only getting two names out of three
image

Since i want to make it dynamic i need it to collect all the names in that row, any idea in how to achive that? :slight_smile:

Hello, i want to leave regex for last option.
But thank you a lot for helping :slight_smile:

Hi @Andre_Vieira
If you decide to make it with regex

Assign a STRING_VARIABLE = System.Text.RegularExpressions.Regex.Matches(INPUT, “(?<=Nome\s)(\S.+)”)
Note: INPUT is the variable to store the values you mention above.

Thanks and regards
Gokul

1 Like

You can use same code, let me know what you don’t want to extract?
Run it without if condition it will work for all as right now it is picking 1 and 2 index value.

Thanks.

1 Like

I didn’t express my self well.

By example: I’m testing with another name like: Paul Chaves Quintero Hortiz.
With that string manipulation I’m only receiving: Paul Chaves.

How can I get the full name?

Just give a try

Refer the screenshot
Screenshot_2

1 Like

Look xD

image

image

But if the name is smaller or bigger the app will crash xD

But the thing is how the bot will know what is the full name of the person?

In last example we have done string manipulation for Nome but you have identified it as Nome Robert is full name so we used 2 index but for bot it’s hard to identified the full names ?

You have to put it in if condition that if the person name is this bot have to pick this much of index value.

1 Like

this can be handle, let me share it again

1 Like

Okay :slight_smile:

Try now.
test.xaml (7.2 KB)

1 Like

Let me test it bro! xD

1 Like