Example:
a43 test1 abc cvb bnm test2 kfo
I need all lines between test1 and test2. Normal grep does not work in this case. Do you have any propositions?
Print from test1 to test2 (Trigger lines included)
test1
test2
awk '/test1/{f=1} /test2/{f=0;print} f' awk '/test1/{f=1} f; /test2/{f=0}' awk '/test1/,/test2/'
test1 abc cvb bnm test2
Prints data between test1 to test2 (Trigger lines excluded)
awk '/test1/{f=1;next} /test2/{f=0} f' awk '/test2/{f=0} f; /test1/{f=1}'
abc cvb bnm
1.4m articles
1.4m replys
5 comments
57.0k users