From: 7stud -- Date: 2008-03-07T08:52:27+09:00 Subject: Re: IO#Foreach -- Max line length Tristin Davis wrote: > But by the time you actually get count, isn't the line already read in > memory. So if the line is 7 gigabytes, it'll probably crash the system. > > Is this what you are looking for: max_bytes = 30 text = IO.read('data.txt', max_bytes) puts text -- Posted via http://www.ruby-forum.com/.