Shell script: Remove blank lines

Hi gurus,

I have this file with blank lines in it.
How do i remove them in shell?
I tried these commands but not working:
sed '/^ *$/d'
or
sed '/^$/d'
Anybody has a better idea pls?

Also there are lines which starts with a single space, how do we remove the space in those lines?
Thanks.

sed '/^$/d'
Should have worked, maybe line not so blank after all...

To see exactly what's in the file, try this:

od -c file_name

Maybe there are non-printable characters.

or. . . . .

grep "[!-~]" file1 > file2

only grabs lines with SOMETHING ASCII in there other than just a space.