perl -000 -ne '($l,$d)=m/Location:\s+(\S+).+BuildDate:\s+(\d.+\d)/s; ($lm,$ld)=($l,$d) if $d gt $ld and m/Approved/s}{print qq|$lm\n|' YOUR-FILE-NAME.txt