file1
HIB12
VH6|KB4
KB4
KB4|LKM98|HIB12
file2
c1 c1 c3 c4 HIB12|LKM98 c6
c1 c1 c3 c4 KB4|LKM98 c6
c1 c1 c3 c4 LL15|VH6
c1 c1 c3 c4 ZZ16|YY15 c6
c1 c1 c3 c4 ZZ16 c6
c1 c1 c3 c4 AB1 c6
Both files are tab-separated. Column1 of file1 has partial match with column5 of file2. Values in both columns are separated by '|' If any value of column1 of file1 is matching with any value of column5 of file5, that row should not be printed in output, other non-matching should be there in output. I tried but not getting expected output
awk 'BEGIN{FS=OFS="\t"} NR==FNR {a[$1]=$5; next} {for (i in a) if (index(i, $5)) print $0, a[i]}' file2 file1
expected output
c1 c1 c3 c4 ZZ16|YY15 c6
c1 c1 c3 c4 ZZ16 c6
c1 c1 c3 c4 AB1 c6
be present in the expected output sinceAB1
doesn't appear in file1?