You're viewing a comment by Duane Meyers and its responses.
You're viewing a comment by Duane Meyers and its responses.
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
I love to read science books. They make my day and I get ideas for awesome blog posts, such as Busy Beaver, On Functors, Recursive Regular Expressions and many others.
Take a look at my
Amazon wish list, if you're curious about what I have planned reading next, and want to surprise me. :)
If you are interested in advertising on catonmat.net, contact me.
Free tools for coding on Vietstarsoft.com.
Programming homework help.


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