Another tool you might try is egrep. To remove lines which start with a #
Code:
egrep -v ^# infile > outfile
The ^ symbol anchors the # to the start of the line so you don't remove a line such as
data # more data
The -v flag means lines other than those which match the pattern.
man egrep for more info