Get only part of a text from a query

I am having a question, from a query returned a message and I have to get a part of this message I know I can use replace and substring but I do not know how to do this, could someone help me?

I made the flow and returned the message that is in the query, if someone can help me I thank you
Main.xaml (7.2 KB)

Hi @Beatriz

Please specify the text in totality and the text/phrase you want to extract out from it.

Regards

Rajat

Hello, I want to know the indexes of “título e valor a ser ajustado” = (120131BEAA2018087584191) after extracting this number I need a last number of the end and do the last 6, ie (758419)

758419 is the only value I need

it is possible?

this is the text

BKO TOP| PF| MENSALIDADE / COBRANÇA PROPORCIONAL_PLANO OU SERVIÇO| VALOR DE MENSALIDADE| EXCEÇÃO| NC|E-MAIL PARA ENVIO: charles.gadita@gmail.com|título e o valor a ser ajustado:120131BEAA 2018087584191/45,33| VALOR PRO-RATA:0,00|VALOR:45,33|NÚMERO DO CONTRATO:15450220/15450218| RESOLVIDO|RESUMO DA ANALISE:CONFORME ANALISE, A COBRANÇA É DEVIDA, POREM O CRÉDITO SERA DEVOLVIDO EM CARATER DE EXCEÇÃO PARA SATISFACAO DO CLIENTE CONFORME POLITICA NEXTEL (R$ 45,33), MANTENDO O BOM RELACIONAMENTO.| CONTATO COM O CLIENTE VIA SMS | TELEFONE: 5521964786115|

Hi @Beatriz,

Using regex split the text
Pattern:(?<=título e o valor a ser ajustado:)(\w* \w*)

So you will get the result as"120131BEAA 2018087584191"

Then split the string using substring
string str="120131BEAA2018087584191"; Console.WriteLine(str); Console.WriteLine(str.Substring(str.Length-6));

Regards,
Arivu

2 Likes

I did the same way but it was wrong, I must be doing something wrong, could you send an example of how to do it?
Sorry, I’m a layman in this software.

@Beatriz

please find the workflow below…

ExtractString.xaml (6.7 KB)

regards,
Pathrudu

Thanks for the help, just a question, the message will come from a procedure, or at each cycle of the robot the numbers of the “título” will change, so what is the value that I put in value no assign?

dtSqlQuery is the variable that returns all data in the query, I tried to use it but it did not work

and the column that returns that message is the “Tabulacao”

try to identify a common pattern for output

I tried your suggestion but it went wrong, if not ask too much you could look at the project and see what I’m doing wrong? I took a print of the procedure also do not know if it helps.
I do not know if I could explain it right but every time the robot rotates the text in the “tabulacao” column will come with the different “titulo” number, if I use the assign and put the value it will return the same text every times.
Thanks again for the help.

test.xaml (7.8 KB)
Sem%20t%C3%ADtulo