Extract text for string

I want to extract text between the blank line, how to get it?

text.txt (3.4 KB)

Probably this should work=

Arr_text - variable array of strings
str_Text - this text above, in your post.

Arr_text = Split(str_Text, environment.NewLine+environment.NewLine)

If you want to get this first part then:

Str_Searched = Arr_text(0)

Second part:

Str_Searched = Arr_text(1)

And etc :slight_smile:

thanks, it does not work

Share this text as a text, not image :wink:

i have post the text file

Sorry, I didn’t noticed it. I read it on my phone. Give me a sec, I will check it.

You can split using CDi
it gives all lines between next CDi

you can increase the number

the total text has hundred of messages, it begins with different string and the number is not continuous

to get countof CDi

i was thinking like, with above split we get total no. count of CDi in string,
then in loop we can simply use Split(yourTextSting,“CDi.”)(counter).toString
and increase counter till total no. count of CDi

just a rough idea ,might require improvement

My solution is working:



If you want to do sth with all of them then use for each loop:



many thanks

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