<p dir="ltr">I have a file with multiple fields;</p>
<p dir="ltr">2 | foo | bar<br>
4 | bar | foo<br>
1 | bar | foo<br>
3 | foo | bar</p>
<p dir="ltr">My goal is to sort the first field numerically and print the first field of the last result.</p>
<p dir="ltr">awk -F"|" '/foo/ {print $1 | "sort"}' </p>
<p dir="ltr">awk -F"|" '/foo/ {number=$1} END {print version}'</p>
<p dir="ltr">Help is greatly appreciated :)</p>
<p dir="ltr">SDA<br>
</p>