Trim whitespace and add line break

All,

I'm a newbie at shell scripting and regular expressions and I just need to take a file that's arranged like the one below, remove all leading and trailing whitespace and add a line break after each word. I've been able to remove a few spaces using various awk, sed and Perl scripts, but without much success beyond that. I appreciate any assistance.

################
ex:

dog       cat        moose        telephone
     house       red      talk
balloon    deer         banana

################

Thanks so much in advance.
Moose

tr -s ' ' '\n' < myFile

Here's a crude way using awk:

awk '{ gsub("^ *","",$0); gsub(" *$","",$0); gsub("  *"," ",$0); gsub(" ","\n",$0); print $0 }' $file

Removes leading and trailing whitespace, replaces multiple consecutive spaces with one space, then replaces the remaining spaces with newlines.

awk ' { for(i=1;i<=NF;++i) print $i } ' file

awk '$1=$1' RS=" " infile # use nawk on Solaris

or

/usr/xpg4/bin/awk NF RS=" " infile # on Solaris

or

gawk NF RS=" " infile

sed "s/  */\\
/g" f | sed "/^ *$/d"

Or:

printf "%s\n" $(<file)

Thanks everyone for helping me. They all worked very well, but I ended up using anbu23's [awk ' { for(i=1;i<=NF;++i) print $i } ' file] script.

Much appreciated.
Moose