in reply to print line
Set the input record separator ($/) to {ID}. Then you can read a record at a time and split the record into hash keys and values. It's trivial to print specific values on the existence or absence of other keys.