How to join, to tsv files, examples:
a.tsv
c 7 r z
d 6 s w
f 1 f f
b 8 p y
a 9 q x
b.tsv
a q a
c r ccc
b p bb
0 0 0
d s dddd
Here I'd like to "join" them by columns, where a$1,a$3==b$1,b$2 and display rest (a$2,a$4,b$3) :
6 w dddd
9 x a
8 y bb
7 z ccc
Question is: how would you do this in gawk ?
Order of rows does not metter (in output. In input, order of rows is not defined and can be different in a.tsv and b.tsv - like rows in relational db, they have no order).
Uniqueness note: Originally, I assumed "uniqueness of key={a$1,a$3}. As glenn jackman noticed - it can not be assumed from original problem statement, as it allows not unique rows according to any key - thanks glenn.