Please use [code][/code]
tags around your code and data, to preserve formatting and to improve readability. Do NOT use quote tags, as they don't preserve whitespace.
It's probably time for you to learn some of the advanced features of awk then.
I'm not going to do all your work for you, but if you redefine the RS
(record separator) as '\n\n'
, it will process the input according to paragraphs, rather than lines. Then you can parse it for fields as usual (just remember that you have to count all the fields in the paragraph now).
It's also easy to test the values of fields, and print only the ones you want. In addition, gawk also has several time functions available:
It looks like you'll have to convert the final field into epoch-seconds before you can compare it to the current date (also in epoch seconds).
Here are a few useful awk references: