Hi,
I need some help on how to print the whole data for unmatched pattern. i have 2 different files that need to be checked and print out the unmatched patterns into a new file. My sample data as follows:-
File1.txt
Id Num Activity Class Type
309 1.1 Vit B6 metabolism Met of Cofac & Vit METABOLIC
10559 1.3 Vit B5 metabolism Met of Sub METABOLIC
File2.txt
ID hit hit_annot
10559 Q12618|AC_AJA Acyl-CoA Ajello cap GN=OLE1 PE=3 SV=1
12509 Q5ZJF4|PR_CH Perox-6 OS Gal GN=PRDX6 PE=2 SV=3
The output should print the 1st and 3rd column of file2.txt:
File3.txt
12509 Perox-6 OS Gal GN=PRDX6 PE=2 SV=3
when i use this script
nawk 'FNR==NR{f2[$1];next} !($1 in f2){print $1, $3}' File1.txt File2.txt> File3.txt
I managed to print the unmatched patterns and the desired column, but it only print the first word like:
12509 Perox-6
it ignores the rest of it (OS Gal GN=PRDX6 PE=2 SV=3). i need the script to print the whole content of the column as displayed above.
Can somebody here kindly help me on this. Thanks