View Single Post
Old 02-21-2006, 11:04 PM   PM User | #4
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Ok I guess my hint wasn't good enough.

Ok here:

Output = new FileOutputStream("myfile.txt");

You have this inside the while loop. With each iteration of the loop you were creating a new instance of that file and essentially overwriting what was written to it the previous iteration. That is why your original code was only writing the last line to the text file.
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote