I have two text files:
File 1:
abc 1x21
and
File 2:
sdc 1x43
xcvyu 03x01
abc 1x21
xyz 4x23
and would like to get
File 3:
sdc 1x43
xcvyu 03x01
xyz 4x23
Found something similar in this thread but it wasn't working for me.
I have two text files:
File 1:
abc 1x21
and
File 2:
sdc 1x43
xcvyu 03x01
abc 1x21
xyz 4x23
and would like to get
File 3:
sdc 1x43
xcvyu 03x01
xyz 4x23
Found something similar in this thread but it wasn't working for me.
Simplest solutions if you GNU grep
:
$ grep -vxf file1 file2 > file3
sdc 1x43
xcvyu 03x01
xyz 4x23
try this line:
awk 'NR==FNR{a[$0];next} !($0 in a)' file1 file2 > file3
didn't test, but should work.
This might work for you (GNU sed):
sed 's|.*|/&/d|' file1 | sed -f - file2 > file3