From: Michele Zio Date: 2008-04-10T03:37:10+09:00 Subject: Re: delete first line of a text file Adam Shelly wrote: > On 4/9/08, Michele Zio wrote: >> hi, >> how can i delete first line of a file? >> > Assuming it's an ASCII file, this should work: (Although it might be > slow on very large files) > > FILENAME="file.txt" > text='' > File.open(FILENAME,"r"){|f|f.gets;text=f.read} > File.open(FILENAME,"w+"){|f| f.write(text)} > > -Adam it's a very small file :) it works very well, thanks a lot!!!!! michele -- Posted via http://www.ruby-forum.com/.