...and why don't you use join to join files? It was meant for exactly this purpose.
Of course it is possible to solve any problem in arbitrarily complex form using tools not suited for the purpose. Still, this begs the question: is there any point to it? Using "awk" for what "join" was intended to do is like using poison ivy instead of toilet paper: less effective while being probably dangerous and perhaps cumbersome.
---------- Post updated at 09:17 AM ---------- Previous update was at 09:17 AM ----------
That was a very funny comparison between poison ivy to toilet paper. I liked it
I am comparing on three columns in each of the file. Join is doing it only on one column. So, I was forced to use awk. Any further suggestions are appreciated.
---------- Post updated at 09:24 AM ---------- Previous update was at 09:17 AM ----------
Actually join can use arbitrary delimiters, so it is possible to use your favourite text filter (awk, sed, ed, tr, ....) to put these in (alternatively remove the respective blanks to make it one key) and remove them (alternatively put them back in) after the join.
You could have come up with this yourself, couldn't you?
Merge first three columns as one key, run join and after I see the output, re split them back with desired delimiters. Thanks for another valuable thought.
I can do that. Thanks for the confidence donation.