You're replying to a comment by Duane Meyers.

Duane Meyers Permalink
February 01, 2012, 15:15

I'm having no luck after many hours of either missing it or just not finding it in doing the google thing. I would greatly appreciate if someone could assist me in printing a line above the line that matches a regular expression and the line above also has the regular expression. I need to do this to find duplicate records in the database (library). File has been split based on 1st field so any lines that are exactly the same matching on the 1st field will be together. Anything not matching exactly will be by itself, thus not a duplicate and there is a blank line between each single and double lines. If the line has the regular expression SERSOL-EBOOK, print the line above it. Since there is blank line between non duplicate entries those single lines are ignored.

1992 Justin Beaver baby baby|SERSOL-EBOOK

1997 Justin Beaver baby baby baby|SERSOL-EBK
1997 Justin Beaver baby baby baby|SERSOL-EBK

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "0day_95": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.