Get multi-line text in between horizontal delimiter with sed / awk -
i multi-line text in between horizontal delimiter , ignore else before , after delimiter.
an example be:-
some text here before delimiter ---------- line 1 line 2 line 3 line 4 ---------- line 1 line 2 line 3 line 4 ---------- text here after last delimiter
and get
line 1 line 2 line 3 line 4 line 1 line 2 line 3 line 4
how do awk / sed regex? thanks.
you can try this.
file: a.awk:
begin { rs = "-+" } { if ( nr > 1 && rt != "" ) { print $0 } }
run: awk -f a.awk data_file
Comments
Post a Comment