Print line, which is situated 2 lines before the match(pattern).
I tried next:
sed -n \': loop /.*/h :x {n;n;/cen/p;} s/./c/p t x s/n/c/p t loop {g;p
If you can use awk try this:
awk
awk '/pattern/ {print b} {b=a;a=$0}' file
This will print two line before pattern
pattern