Extract a word in a specific line

Extract a word in a specific line

Use Case Description

Hi, there is someone that can help me in extracting a specific word from a text? In the text attached below, I’m able to extract the word “NUMERO REGISTRO CERTIFICATO”, and I need to extract the word that is placed two lines below, in this case “IOAROS”. The word “NUMERO REGISTRO CERTIFICATO” is always present in the text, while the word “IOAROS” change everytime.

Here the text
numero e la data di protocollo unico.
MINISTERO DELLA GIUSTIZIA - SISTEMA INFORMATIVO DEL CASELLARIO (SIC)
e J’ZøguJVe4e CCømøVwzø
Sistema Informativo del Casellario
Certificato dell’Anagrafe delle sanzioni amministrative dipendenti
A’ nome di:
Forma Giuridica
Denominazione
Sede
Codice Fisca}e
sulla richiesta dj:
per uso: da reato
(ART. 32 IN RELAZ. ART.31 D.P.R. 14/112002 N.313)
NUMERO REGISTRO CERTIFICATO: 32282/2021/R
S.R.L. - SOCIETA’ A RESPONSABILITA’ LIMITATA
IOAROS
VIA 20 - BOLOGNA ( ITALIA )
3604761209
ENEL ITALIA GLOBAL di ROMA ( PROT. NO 578 del 08/0712021 )
(ART. 32 IN RELAZ. ART.31 D.P.R. 14/11/2002 N.313)
Si attesta che ne!i’anagrate delle sanzioni amministrative dipendenti da reato risulta
ESTRATTO DA: CASELLARIO GIUDIZIALE - PROCURA DELLA REPUBBLtCA PRESSO TRIBUNALE Dl
ROMA
ROMA, 23/09/2021 09:13 g BILE DEL SERV C RTIFICAT’VO
II certificato sopra esteso viene rifasciato in data odiema, a seguito di richlesta della pubblica amministtazione I gestore di pubblici servizi
finalizzata all"accertamento düficio di stati, qualitä e fatti owero al controllo sulta veridicitä dena didliarazione sostitutiva presentata
daff"lnteressato (articoli 43, 46 e 71 d.P.R. 28 dEcembre 2000, n. 445).
Resta fermo il divieto di utilizzare eventuali dati personali, e dati giudiziari in partico!are, non indispensabili atto specifico adempimento previsto
nell"ambito del procedimento amministrativo a.li si riferisce 'a iichiesta, ai sensi del d.lgs. 30/06/2003, n. 196 e succ. mod. (codice in materia di

AS-IS WORKFLOW, TO-BE WORKFLOW

Word extraction.docx

Other information about the use case

Industry categories for this use case: Information Technology and Services

Skill level required: Advanced

UiPath Products that were used: UiPath Studio

Other applications that were used: -

Other resources: -

What is the top ROI driver for this use case?: Accelerate growth and operational efficiency

Hi

Hope the below steps would help you resolve this

  1. If the input is in a string variable named Strinput then First let’s separate each line as a array of string like this in a assign activity

arr_lines = str_input.ToString.Split(Environment.NewLine.ToArray())

  1. Then use a assign activity again and mention like this to get your output

stroutput = arr_lines(Array.IndexOf(arr_lines,”NUMERO REGISTRO CERTIFICATO”)+2).ToString

Cheers @michele.amato1

stroutput = arr_lines(Array.IndexOf(arr_lines,”NUMERO REGISTRO CERTIFICATO”)+2).ToString

Hi sorry can you explain further on how exactly this line work? Thanks a lot!

1 Like

Hi

Welcome to uipath forum

As the question was like to get the the sentence in two lines below to this sentence
“ NUMERO REGISTRO CERTIFICATO”

So first we need to split the entire text to individual lines
And get the position of the line having above sentence which can be obtained through index position of line in the group of lines we had with last step

Then add +2 to the line index and get the value of the sentence which 2 lines after the above sentence

Cheers @Melee_Noob

Appreciate the reply, the reason that im asking is because when i change the +2 to +4, it dont work as intended for me. Only when i changed it to +12 then it worked. Thanks a lot!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.