From: Arlen Cuss Date: 2008-03-07T08:44:40+09:00 Subject: Re: IO#Foreach -- Max line length ------=_Part_31677_6637598.1204847087427 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, On Fri, Mar 7, 2008 at 9:37 AM, 7stud -- wrote: > max = 3 > count = 0 > > IO.foreach('data.txt') do |line| > if count == max > break > else > count += 1 > end > > puts line > end Not quite the solution. This reads a number of lines, as opposed to limiting the length of a single line read. Arlen ------=_Part_31677_6637598.1204847087427--