help on shell script to check line

Hi Scripting Gurus,

Can someone help to transform the below logic into a shell script, might be easy for some of you.

I have a file with below text, I need if the line has the ":" and the above to it is not a blank line should print " <text>: is incorrect format"

Apple:
vitamin = A
Banana:
vitamin = A

Orange:
vitamin = C

So, If I run the script on above file, it should say Banana: is not a correct format

Please ignore this post.. Posted in the wrong thread.

Please post whatever u have tried so far and we can help you out further

#  nawk '$0~":"&&t!=""{print $0" is incorrect format"}{t=$0}' infile
Banana: is incorrect format

HTH