How sed to print match's previous line?

April 27, 2011 at 20:16:35
Specs: Windows 7
I have a data like this:
5
3
8
@abc@
10
2
@cde@
@ijk@
4
19
---------------------------
I want to make this:
8
@abc@
2
@cde@
2
@ijk@
--------------------------
How can I use sed command to do this?

See More: How sed to print matchs previous line?

Report •

#1
April 28, 2011 at 12:58:54
This problem looks simple enough using awk, but I think it would be difficult using sed. Anyway, it's nothing I want to tackle unless I can use awk.

Maybe you can get some help at this site:

http://main.rtfiber.com.tw/~changyj...

Check under the Patterns link.


Report •
Related Solutions


Ask Question