I have a file like
blah
blah blah blah
this is the text I need,
which might be between 1-4 lines, but
always has a blank line above and below
it, and is at the end of the text file
the code tags don't show the trailing blank line. I started by deleting the last blank line with:
sed -i '$d' textfile
but how to I get sed to give me the next 1-4 lines above that output to somenewfile.txt, but stop at the next blank line above it?