Extract words from pdf

Hello friends,
@rkelchuri, @Ninett_Panfir, @Rammohan91, @balupad14, @Florent_Salendres, @vvaidya, @Palaniyappan

I have a pdf file in which I need to extract the two dates informations from these line:
Data richiesta 15/06/2019 Scadenza validità 13/10/2019
How to do that with regex?
Thank you so much,
Cami :slight_smile:

2 Likes

@CamiCat you can get them through scrape relative buddy

3 Likes

try with this @CamiCat
if the value is stored in a string variable
in_value = “Data richiesta 15/06/2019 Scadenza validità 13/10/2019

then
in_value = Regex.Replace(in_value,“[^a-zA-Z]”,“”)

3 Likes

How to do that @venkatmalla6?
Thank you,
Cami

3 Likes

@CamiCat,
In your string " Data richiesta" is stable word. it will always available.
So, use Split string activity. Seperator should be Data richiesta
and Left(outPut(0),10) will give you 15/06/2019. similarly use Scadenza validità for another split string activity and Right(outPut(0),10) will give you 13/10/2019

Hope my inputs are useful.

3 Likes

Fine
i tried to reproduce your issue


the expression used is

–and before this to get the value from the pdf use read pdf or read pdf ocr activity and get the data in a variable of string type
–we can use string manipulation like this line starts with word Data richiesta then we can use like this
–use read pdf or read pdf ocr and get the output with string variable named out_string
–use assign activity and mention like this
out_string_array = out_String.Split(Environment.Newline.ToArray())
–use a for each loop and pass the above variable as input and change the type argument as string in the property of for each loop
–inside this loop use a if condition like this
item.Contains(“Data richiesta”)
if this passes it will go to THEN part where we can put the above image mentioned but change the in_value variable with item (the variable from for each loop and that has the value “ Data richiesta 15/06/2019 Scadenza validità 13/10/2019 ” )

thats all you are done
Hope this would help you
Cheers @CamiCat

5 Likes

@CamiCat in recordings we have image recording in that screen scraping there is a option scrape relative
rough3.xaml (10.3 KB) in this way you can get.have a look at this.hope this would help you.

3 Likes

Thenk you so so much @Palaniyappan.
I’ll try and let you know as soona s possible.
Cami :slight_smile:

3 Likes

Thank you so much @venkatmalla6.
I’ve tried your solution and worked very well.
Thank you,
Cami :slight_smile:

3 Likes

@CamiCat that’s great buddy cheers.

3 Likes

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