I have some data that looks like this:
abc 123 456 789 def 111 222 333 ghi 999 888 777 666 i.e. the records are separated by multiple newlines but in the wrong place. What I want is to get it like this:
abc 123 456 789 def 111 222 333 ghi 999 888 777 666 I have tried setting RS to \n\n\n in awk but that ends up with the records cut up wrong; the abc term ends up as the final field of the previous record rather than the first field of the current record.
I'm not sure how to use sed for this either since that works on a line-by-line basis.