I have the file:
s3_T0(2) Pos "1" "2"
s1_T1(2) Pos "1" "2"
---
0 0
1 0
0 1
1 1
---
1 2 "tau0"
1 2 "h10"
I want to patternmatch on ---
and get only the third part i.e.
1 2 "tau0"
1 2 "h10"
I wanted to start simple but even something like
awk '/---/{x="F"++i;}{print > x;}' file2
does not work.
Any suggestion appreciated.
Thanks, but the rest of the file can be quite big aND not necessarily starting with 1 2.
I want the part after the second --- no matter what it is.
Hello try
nawk '{A[++c] = $0} END { for ( i = 1; i <=c; i++ ) {if(A ~ "---") {d++} { if ( d == 2) print A[i+1]}}}' file
Try this:
awk '/---/{p++;next} p==2' file
1 Like
thanks, both solutiuons work well!