I have two tab delimited files, file 1 contains identifiers and file 2 has values related to these identifiers (or say it is a very big dictionary).
file 1
Ronny Rubby Suzie Paul
file 1 has only one column.
file 2
Alistar Barm Cathy Paul Ronny Rubby Suzie Tom Uma Vai Zai 12 13 14 12 11 11 12 23 30 0.34 0.65 1 4 56 23 12 8.9 5.1 1 4 25 3
n number of rows are present in file 2.
what I want, if the identifiers of file 1 are present in file 2, I should have all the values related to it in an another tab delimited file.
Something like this:
Paul Ronny Rubby Suzie 12 11 11 12 23 12 8.9 5.1
Thank you in advance.
An example in Python that does the work in stream (ie: don’t need to load the full file before starting the output):
Output: