I have long text files with space-delimited fields:cat file1.txtId    leng  sal   mon25671 34343 56565 556544888 56565 45554 686823343 23423 26226 622477765 88688 87464 684866776 23343 63463 4534cat file2.txtId    number25671 34343 76767 34234 23343 23423 66776 23343 cat output.txtId    leng  sal   mon44888 56565 45554 686877765 88688 87464 6848file1.txt has four columns, file2.txt has two columns. I want to compare 1st column ($1) in both files (file1.txt, file2.txt) and output the file that did not match in file2.txt.I have triedjoin -v1 file1.txt file2.txt >output.txtBut the output has some errors. Any awk/sed command is appreciated.
Compare two file columns
sed;awk;perl;join
In order to use join, you need to make sure that FILE1 and FILE2 are sorted on the join fields.The following command should do the trick:join -v1 <(sort file1.txt) <(sort file2.txt)