I have the following for getting the lines matching a variable using awk:
for i in `cat file1`; do awk -v id="$i" '$0 ~ id' file2; done
How can I do the opposite? Getting the lines that DON'T match? I think I should use ! somewhere, but don't know where.
File 1 looks like this:
5NX1D
5NX3D
4NTYB
File 2 looks like this:
2R9PA IVGGYTCEENS
2RA3C RPDFCLEPPYT
6HARE YVDYKDDDDKE
4NTYB EYVDYKDDDDD
Output should look like this:
2R9PA IVGGYTCEENS
2RA3C RPDFCLEPPYT
6HARE YVDYKDDDDKE