How to read between line?


#1

i have a text file like

bla bla bla
bla bla bla
bla bla vasdasdasd
//rs:data
please read me se
please read me gr
please read me ew
please read me se
please read me cg
//rs:data
saddsagkobn
bla bla bla

i just want to read the in between lines of //rs:data
How can i do this


#2

Hi @jothyprasanth.m

If the line to be fetched starts with or has standard prefix like “//” you can split the string using keyword and new line character as delimiter and you can get the required line.

Regards,
Ranjith.


#3

Hey @jothyprasanth.m

this is one of the way

You can get first index of(position) "//rs:data " and similarly you can get last index of(position) of “//rs:data” then by using Substring you will get your output.

For your reference a sample workflow : extract_lines_btw_two_strings.xaml (6.6 KB)

Regards…!!
Aksh


#4

hey aksh1yadav if i want next 2 lines after searching keyword //rs:data then?
means i want
please read me se
please read me gr
please read me ew
please read me se
these 4 lines after searching the keyword //rs:data