Break lines up into single lines after each space in every line

It sounds a bit confusing but what I have is a text file like the example below (without the Line1, Line2, Line3 etc. of course) and I want to move every group of characters into a new line after each space.

Example of text file;
line1 .digg-widget-theme2 ul { background: rgb(0, 0, 0) none repeat scroll 0% 0%; }
line2 .digg-widget-theme2 li { color: rgb(102, 102, 102); }
line3 .digg-widget-theme3 { border-color: rgb(221, 221, 221); }
line4 .digg-widget-theme3 ul h3 a:link, .digg-widget-theme3 ul h3 a:visited, .digg-widget-theme3 ul h3 a:active { color: rgb(73, 124, 172) ! important; }
line5 .digg-widget-theme3 ul h3 a:hover { color: rgb(0, 0, 0) ! important; }
line 6 .digg-widget-theme3 .digg-widget-header, .digg-widget-theme3 .digg-widget-footer, .digg-widget-theme3 .digg-widget-topic { background: rgb(204, 204, 204) none

What I want to achieve:

Line1 for example;

.digg-widget-theme2
ul
{
background:
rgb(0,
0,
0)
none
repeat
scroll
0%
0%;
}

Line2 for example;
.digg-widget-theme2
li
{
color:
rgb(102,
102,
102);
}

The end result should look like this (Included the examples above);

ul
{
background:
rgb(0,
0,
0)
none
repeat
scroll
0%
0%;
}
.digg-widget-theme2
li
{
color:
rgb(102,
102,
102);
}

This is what you are looking for.,

sed 's/ /\n/g' input-file

So output as expected, ( example, not the whole )

.digg-widget-theme2
ul
{
background:
rgb(0,
0,
0)
none
repeat
scroll
0%
0%;
}


Hi Geek,

I was also trying the solution for the above one.. even though i was trying your solution, i was not getting the result. can you tell me where i am going wrong.

d>cat a.txt
.digg-widget-theme2 ul { background: rgb(0, 0, 0) none repeat scroll 0% 0%; }
.digg-widget-theme2 li { color: rgb(102, 102, 102); }
d>sed 's/ /\n/g' a.txt
.digg-widget-theme2nuln{nbackground:nrgb(0,n0,n0)nnonenrepeatnscrolln0%n0%;n}
.digg-widget-theme2nlin{ncolor:nrgb(102,n102,n102);n}

@thegeek woah! It worked super fine, thanks man!

---------- Post updated at 02:46 PM ---------- Previous update was at 02:03 PM ----------

Strange that it is not working for you. Are you trying it from a UNIX prompt? Can't think that the type of shell would influence it but I tried it on a BASH shell.

Maybe try on another box and see?

don knw.. earlier i tried in SunOs.. But this time, i tried in AIX.. still the same result...
what is your OS?

awk '{print $0}' RS=" " e.txt
tr -s ' ' '\n' < myFile

I did it via Cygwin but also tried it via bash on my linux box and it worked fine. I see other guys also posted examples. Maybe try that too.