Dear developpers,
I intend to compare the file1 to the file2 based on the values of column 1 in file1. However, the current code - that I modified from the forum- only print matches. I am wondering if there is a solution to have both matches and non matches being printed.
Many thanks in advance and sorry for the basic question
File1
abc
ddd
cnn
File2
abc zzz
A zzz
A zzz
A zzz
Current code output :
awk -F"\t" 'FILENAME=="file1"{A[$1]=$1}
FILENAME=="file2" {if(A[$1]){print$0} else {????????"\t" "0"}}' file1 file2
abc zzz
0
0
0
The intended output ideally is similar to:
abc zzz
ddd 0
cnn 0