Input:
===================================
v2.0.0
Added feature 3
Added feature 4
===================================
v1.0.0
Added feature 1
Added feature 2
===================================
Output that I want:
v2.0.0
Added feature 3
Added feature 4
I tried this but it gets the first equals (=) and the LAST equals (=) while I want to get is the FIRST TWO equals (=)
Here is one in awk:
$ awk '/^=+$/{f=!f;if(f==1)next;else if(f==0)exit}f' file
v2.0.0
Added feature 3
Added feature 4
In pretty print:
$ awk '/^=+$/ { # at ===...
f=!f # flag state is flipped
if(f==1) # if its one (first ===...)
next # next record
else if(f==0) # if zero (second ===...)
exit # nothing more to do yeah
}
f' file # print
Could you please try following too.
awk '/^=/{count++;next} count>=2{exit} {print}' Input_file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With