Extracting specific lines from string

Hello,

I have string from pdf, file, in which only specific lines interest me. Lets say they are starting with numbers, and not always are in the same order. Is any extraction method that would be helpful for me? For example, searching for some specified string, and getting characters after that to another variable?

Regards,

Hello Rafał,

you can use Regex to find specific Strings/Lins

Regards
Aditya

HI
Can you be more specific on what type of string patterns that you want to extract from PDF?

Thanks.

Hi @aditya.prakash

Whats regex?

Hi Karnik,

Regex is used for Type match

suppose if you have to Select all Email Ids from a String or any particular String type you can use Regex!

you can use online Regex editors
https://regexr.com/

Regards
Aditya

Sure,

I would like to get time value from “1 Sun 00:00 08:00 08:00”. Sometimes could be more characters after, but I am interested only in 3 first time value.

Furthermore, I need to extract value from line which is under specified one.

@aditya.prakash

Oh ok :slight_smile:
Thanks for the info.

Regards,
Karnik

EDITED: This(these) pattern(s) worked:

.[0-9]:[0-9].+[0-9]:[0-9].

[0-9]+:[0-9].+[0-9]:[0-9]+

Result:
1

2 Likes

It helps! Do you have any solution for finding line which is under specified words?

Specified words
Line I need to extract

Sorry i did not quite get that.

What do u mean?

I need to extract specific string which can change depending on input, but always appears after the same phrase.

Here is line which is always the same.
Here is line I need to extract.