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
Given the awk script
BEGIN { fout="headers" } /^$/ { fout="body" } { print $0 > fout }
awk -f foo.awk < httpfile will write out the two files headers and body for you.
awk -f foo.awk < httpfile
headers
body