[Solved] Remove lines from a text file that contains multiple string patterns from another file in linux [closed]


$ cat tst.awk
BEGIN { FS = "[\t|]" }
NR==FNR {
    for (i=1; i<=3; i++) {
        if ($i == "") {
            $i = "N.A."
        }
    }
    a[$1 OFS $2 OFS $3]
    next
}
!(($3 OFS $5 OFS $6) in a)

$ awk -f tst.awk file1 file2
123|234|aa|ur29842|b|c|234|567
123|234|aa|ur2909842|bb|ccc|234|567
123|234|aaa|ur29042842|bb|cc|234|567
123|234|N.A.|ur2922|bbb|cccc|234|567

0

solved Remove lines from a text file that contains multiple string patterns from another file in linux [closed]