I know that in other questions you solve the first part of “How to remove the lines which appear on file 1 from another file 2” with: comm -23 file1 file2 and grep -Fvxf file1 file2 But in my case I have empty lines separating data sets that I need to keep, for example: File 1: File 2 what I