Hi Franklin,
Thanks a lot !
It almost worked.
Except that some additional lines are deleted.
This is because pattern2 and pattern3 are occurring more than once in the file.
Pattern1 has a single occurrence. e.g. as below :
aaaaaaaa
bbbbbbbb
pattern1
cdededed
ddededed
pattern2
fefefefe <-----Delete this line
efefefef <-----Delete this line
pattern3
adsffdsd
huaserew
pattern2
asdsaga <----Not to be deleted
ashksds <----Not to be deleted
pattern3
asdsasd
rertertrr
Should have posted the above at the start, which would have given you the complete information.