I have two files, with the pattern
file1 (smaller file)
001 word1
002 word2
... ....
00n wordn
file2 (bigger file)
001 word3
002 word4
... ....
00n wordn
I want to get an output file that keeps only matching lines from both files, based on the first column of file1 and joins the two lines where it finds a common column ID, such as, for example
001 001 word1 word 3
Tried various comobos of join, grep and awk but the task seems to be beyond me.
Many thanks!
question from:https://stackoverflow.com/questions/65829613/joining-two-files-based-on-first-column-ids