From: botp Date: 2008-12-11T12:55:14+09:00 Subject: Re: copy txt file - only copies 1/3 of the file - what happened? On Thu, Dec 11, 2008 at 11:37 AM, Mmcolli00 Mom wrote: > File.open('oldFile.txt', 'r') do |f1| #file contains XML type data > m = f1.gets ok, this gets just one line of text fr f1 > File.open('newFile.txt','w') do |f2| #newFile to separate data in > oldFile > f2.puts m.split("<") and you placed that one line on f2 > end > end and that is all. you just copied one line. hint: File.open by itself does not loop.