Compare 2 files and remove any lines in file2 when they match values found in file1

前端 未结 4 685
死守一世寂寞
死守一世寂寞 2020-12-10 22:11

I have two files. i am trying to remove any lines in file2 when they match values found in file1. One file has a listing like so:

File1

ZNI008
ZNI009         


        
4条回答
  •  悲&欢浪女
    2020-12-10 22:45

    I like the grep solution from byrondrossos better, but here's another option:

    sed $(awk '{printf("-e /%s/d ", $1)}' file1) file2 > file3
    

提交回复
热议问题