How to display search result of a string in different lines in revelance

Hi All,

I have my /etc/resolv.conf file in unix servers which looks like this

//file start
domain xyz.com
nameserver 10.10.10.11
nameserver 10.10.10.12
nameserver 10.11.10.11
//file end

I need to search for for “nameserver” and display the result in different properties

Thanks in advance

I’m not clear on what or how you want the output to look like but hopefully the following could get you started:

Q: following texts of firsts "nameserver " of lines of file "/etc/resolv.conf"
A:  10.10.10.11
A:  10.10.10.12
A:  10.11.10.11
I: plural substring
1 Like