(1) sed '/^#/!{p;d;};s/[ \t]*//;h;:a;${x;s/\n//;p;q;};n;s/^[ \t]*//;s/[ \t]*$//;/^#/{x;s/\n//;p;x;h;ba;};H;ba'
sed '/deal received/!{p;d;};s/[ \t]*//;h;:a;${x;s/\n//;p;q;};n;s/^[ \t]*//;s/[ \t]*$//;/^#/{x;s/\n//;p;x;h;ba;};H;ba'
(2)sed -n '/#/{:a;N;/\n#/{P;D};s/\n//;$p;ta}'
sed -n '/deal received/{:a;N;/\ndeal received/{P;D};s/\n//;$p;ta}'
(3)sed ':a;$!N;/\n#$/!s/\n//;ta;s/#/\n#/g'
sed ':a;$!N;/\ndeal received$/!s/\n//;ta;s/deal received/\ndeal received/g'
******(4)sed -n '1h;/#/!{1!H;$!b};1!{x;s/\n//g;p}' file
sed -n '1h;/deal received/!{1!H;$!b};1!{x;s/\n//g;p}' file
(5)awk '/@/{printf "\n"$0;next}{printf $0}' file
awk '/.*deal received.*/{printf "\n"$0;next}{print $0}' file
********(6)awk '/^Include/{T=1}T{if (NF) printf $0;else {print "\n";T=0}next}1' file
awk '/*deal received*/{printf $0;else {print$0}' file