in reply to to delete a set of specific lines in a file
Read the file line-by-line. Store each line in an array
After getting the second line, check whether the line is already there in the array
If so then remove the line
Using grep to check, will be easier