Hi All
I'm trying to extract the line just above a regexp and all lines after this.
I'm currently doing this in two steps
Sample
Result
Is there a way I can achieve this using a one liner?
I'm trying to extract the line just above a regexp and all lines after this.
I'm currently doing this in two steps
Code:
sed -n -e "/^+---/{g;p;}" -e h oldfile.txt > modified.txt
sed -e "1,/^+---/d" -e "/^$/d" oldfile.txt >>modified.txt
Code:
sometext will be here
sometext will be here
sometext will be here
sometext will be here
ACD (A)
+------------------------+------------------------
(some info) 19082
(something else) 19082
Code:
ACD (A)
(some info) 19082
(something else) 19082