I have a file which contains messages.
A message is separated by $ in this file.
In each message we need to get string aftr :20: and send it to an output file. If :20: is not prsent in a message then we need to search for :20C: and send the corresponding string to o/p file. if dat too is not present then search :20D: in same message. If nothing prsent among :20:,:20C:,:20D: then we need to send a blank line to o/p corresponding to that message.
Please help.
Seems to print result from last match when line is missing all of :20: and :20C: and :20D:
This update fixes it by matching to nothing before doing the :20(CD): match