I have a file that has some lines starts with *
I want to get these lines, then get the word between "diac" and "lex".
ex.
file:
;;WORD AlAx
*0.942490 diac:Al>ax lex:>ax_1 bw:Al/DET+>ax/NOUN+ gloss:brother pos:noun prc3:0 prc2:0 prc1:0 prc0:Al_det per:na asp:na vox:na mod:na gen:m num:s stt:d cas:u enc0:0 rat:y source:spvar stem:>ax stemcat:N0F
--------------
;;WORD gyr
*0.983117 diac:gayoru lex:gayor_1 bw:+gayor/NOUN+u/CASE_DEF_NOM gloss:not;other pos:noun prc3:0 prc2:0 prc1:0 prc0:0 per:na asp:na vox:na mod:na gen:m num:s stt:c cas:n enc0:0 rat:y source:lex stem:gayor stemcat:N
Desired output:
Al>ax
gayoru
I am not sure if I should use sed or grep. Have been trying for a while, with this command:
grep -A 3 -o ':.* lex:' boo
I get:
:Al>ax lex:
Thank you in advance!