SyntaxFix
Write A Post
Hire A Developer
Questions
You can do all of it in awk:
awk
<file awk '$1 ~ /A1/ {m=$NF} END {print m}'