I have this file1.txtdeiauk 9kespaul 8luktol 7 titkur 6and other file2.txtkespaul bdeiauk a And I want to merge both files in one by first value, so my result should bedeiauk 9 akespaul 8 bluktol 7 titkur 6
Merge two files
shell script;text processing;join
sort file2.txt | join -a 1 file1.txt -join requires sorted input. The '-' specifies that standard input will be used for the second file, which allows the output of sort to be used as input. The '-a 1' specifies that non-matching lines from the first file will be included in the output. 