I am trying to remove all extra rows between some text.. lets say:

XXXXX
-------
-------
YYYYY


I am trying to remove all ------ part like i want to keep row #1 & #3 but i want to remove row #2, ,how can i do that? And i am not talking about 1 row, there are more than 10,000 records