Hi all:
I have a file in which the contents are as following:
...
This is a test
ONE
TWO
Hello, world!
XXX YYY CCC
test again
three, four
five
six
seven
world
AAA BBB QQQ
test
eight, nine
world
FFF EEE KKK
...
I want to use
sed to merge all lines between a line that contains a word 'test' and a line that contains a word 'world' into one line, and ignore other lines. In other words, I want a result as following:
This is a test ONE TWO Hello, world!
test again three, four five six seven world
test eight, nine world
Any help is appreciated. Thanks in advance for your help!
Sincerely,
Susan