Found easiest solution sofar to extract 3rd and 5th line after pattern (searching huge error logs)
but output I got is 2 lines and I want them merged.
Please advice.
Sample:
pattern
1st line
2nd line
3rd line
4th line
5th line
pattern 2
1st line after second pattern
2nd line after second pattern
3rd line after second pattern
4th line after second pattern
5th line after second pattern
using :
awk '/pattern/ {nr[NR+3]; nr[NR+5]}; NR in nr'
I got
3rd line
5th line
3rd line after second pattern
5th line after second pattern
But how to get:
3rd line 5th line
3rd line after second pattern 5th line after second pattern
Thank you