I have a text file comprising two tab delimited columns. I wish to grep each line (i.e. a character string comprising two tab delimited values) in another file. The first file has an empty line at the end. If I delete the empty line, the command below works fine. But if I don't, it does not.
I can delete the line, but would like to know why it fails. Also, my attempts to get round the problem without deleting the line also fail. Please help? Thanks.
This command works fine if the empty line is deleted:
grep -wF -f file1 file2 > file3
I have tried to get around the problem without deleting the line, by trying things like
grep '.' file1 | grep -wF - file2 > file3
But can't get it to work.
grepread patterns off a file with Windows line endings, i.e. with the extra carriage returns.