From: Christophe Broult Date: 2002-03-04T23:25:17+09:00 Subject: RE: Load a Text file (newbie) This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C1C388.64C2A150 Content-Type: text/plain > -----Original Message----- > From: Douglas J van Vliet [mailto:dougie@global.co.za] [..] > Hi, > > Is there a way of loading a text file in memory and then > accessing the lines > one at a time? IO.readlines('c:/autoexec.bat').each { |line| print line } > > The files are 4 to 9MB's and take 15 - 20 seconds to load a > line at a time. > > If I use SmallScript (Smalltalk), it takes less than a second > or two to load > it. (remainingContents) > > Dougie > > ------_=_NextPart_001_01C1C388.64C2A150 Content-Type: text/html RE: Load a Text file (newbie)

> -----Original Message-----
> From: Douglas J van Vliet [mailto:dougie@global.co.za]
[..]
> Hi,
>
> Is there a way of loading a text file in memory and then
> accessing the lines
> one at a time?

IO.readlines('c:/autoexec.bat').each { |line| print line }

>
> The files are 4 to 9MB's and take 15 - 20 seconds to load a
> line at a time.
>
> If I use SmallScript (Smalltalk), it takes less than a second
> or two to load
> it. (remainingContents)
>
> Dougie
>
>

------_=_NextPart_001_01C1C388.64C2A150--