OK, turing.

<- leave blank

Mon Jun 11 17:52:47 EDT 2018

$ cat selection3
1|foobar|7549
2|foobar|35542
3|foobar|827
4|foobar|0
5|foobar|0
6|foobar|526
7|foobar|0
$ awk -F'|' 'BEGIN { OFS = FS } /\|[0-9]+$/ { "echo " $3 | getline t; $3 = t; } {
print }' selection3
1|foobar|7549
2|foobar|35542
3|foobar|827
4|foobar|0
5|foobar|0
6|foobar|526
7|foobar|526
$ awk -F'|' 'BEGIN { OFS = FS } /\|[0-9]+$/ { "echo " $3 | getline $3; } { print
}' selection3
1|foobar|7549
2|foobar|35542
3|foobar|827
4|foobar|0
5|foobar|0
6|foobar|526
7|foobar|0