Blank lines can be removed from a file with any of the following:
:v/./d
or
:g/^$/d
or
:%!cat -s
or
:%!sed /./,/^$/!d
Be aware that you may need to get rid of trailing whitespace first.
This can be accomplished with
:%s/[ ^I]*$/!d