From: William James Date: 2007-01-03T08:25:05+09:00 Subject: Re: Delete line from file Jules wrote: > Hi, > > Given a line number, what is the best way to delete this line from a > file? > > And given an array of line numbers, what is the best way to delete > these lines from a file? > > Thanks, > > Jules lines = IO.readlines('junk1') [1,3,5].each{|n| lines.slice!(n) } open('junk1','w'){|f| f.puts lines}