delete blank lines or lines with spaces only

hi there
i'm trying to delete blank lines and or lines with spaces only from a series of files in an directory.
to do so, i'm using this:

for files in `ls /users/myname/pesop* 2>/dev/null`
do
grep -v ^$ $files > newfile
mv newfile $files
done

now, this works great for blank lines but doesn't work for lines with spaces. The number of spaces is uncertain.
maybe it would be better with SED, but i dont know how to use it.
can anyone help me?
thanks

egrep -v " +" filename

This will do the trick of removing more than one spaces line also

Regards
JK

This will remove blank lines and those which only contain spaces...

grep -v '^ *$' $files

If you wanted to use sed, then...

sed '/^ *$/d' $files

Thanks
It worked great.