I want to split a file containg HTTP response into two files: one containing only HTTP headers, and one containg the body of a message. For this I need to split a file into
$ cat test.txt a b c d e f $ sed '/^$/q' test.txt a b c $ sed '1,/^$/d' test.txt d e f
Change the /^$/ to /^\s*$/ if you expect there may be whitespace on the blank line.
/^$/
/^\s*$/