Remove newlines (\n) if they are followed by a string - using SED

Viewed 1905

I have a text file and I need to remove newlines if they are followed by the string "fox"

the 
brown 
fox 
jumps 

will become

the 
brown fox 
jumps 

I would like to do it in SED, but the AWK solution would be useful too.

3 Answers
Related