Text formatting

Hey guys, i am having a problem formatting my text in a file. what i did was to extract some information from a html file and i would like to format it. Currently my information comes out in this way...


Cast (Cast overview, first billed only) Sam Worthington ... Jake Sully Zoe Saldana ... Neytiri Sigourney Weaver ... Dr. Grace Augustine Stephen Lang ... Colonel Miles Quaritch Joel Moore ... Norm Spellman (as Joel David Moore) Giovanni Ribisi ... Parker Selfridge Michelle Rodriguez ... Trudy Chacon Laz Alonso ... Tsu'tey Wes Studi ... Eytukan CCH Pounder ... Moat Dileep Rao ... Dr. Max Patel Matt Gerald ... Corporal Lyle Wainfleet Sean Anthony Moran ... Private Fike Jason Whyte ... Cryo Vault Med Tech Scott Lawrence ... Venture Star Crew Chiefmore


what i would like to achieve is for the program to read the empty spaces and then based on then , paste it to a newline and continue.. for example...

1
2
3
4
5
6
7
8
  Cast  (Cast overview, first billed only)        
Sam Worthington ... Jake Sully  
Zoe Saldana ... Neytiri  
Sigourney Weaver ... Dr. Grace Augustine 
 Stephen Lang ... Colonel Miles Quaritch 
 Joel Moore ... Norm Spellman (as Joel David Moore) 
 Giovanni Ribisi ... Parker Selfridge 
 .....



Anybody can give some clue on how i can format my text according to this way? Hope for some help in this. Thanks!

You're going to have to output the newlines when you extract the information from the HTML file. There is not enough information in your text file to format it the way you want in its current form.
How do i output the newlines when i extract the informaiton from the html file? like based it on a unique id? could you give me an example of how i am able to do it?
What does the program that extracts the data from the HTML file look like?
Topic archived. No new replies allowed.