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.
------_ extPart_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
>
>
------_ extPart_001_01C1C388.64C2A150
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV
ontent-Type" CONTENT ext/html; charset -ASCII">
<META NAME enerator" CONTENT S Exchange Server version 5.5.2653.12">
<TITLE>RE: Load a Text file (newbie)</TITLE>
</HEAD>
<BODY>
<P><FONT SIZE > -----Original Message-----</FONT>
<BR><FONT SIZE > From: Douglas J van Vliet [<A HREF ailto:dougie / global.co.za">mailto:dougie / global.co.za</A>]</FONT>
<BR><FONT SIZE [..] </FONT>
<BR><FONT SIZE > Hi,</FONT>
<BR><FONT SIZE > </FONT>
<BR><FONT SIZE > Is there a way of loading a text file in memory and then </FONT>
<BR><FONT SIZE > accessing the lines</FONT>
<BR><FONT SIZE > one at a time?</FONT>
</P>
<P><FONT SIZE IO.readlines('c:/autoexec.bat').each { |line| print line }</FONT>
</P>
<P><FONT SIZE > </FONT>
<BR><FONT SIZE > The files are 4 to 9MB's and take 15 - 20 seconds to load a </FONT>
<BR><FONT SIZE > line at a time.</FONT>
<BR><FONT SIZE > </FONT>
<BR><FONT SIZE > If I use SmallScript (Smalltalk), it takes less than a second </FONT>
<BR><FONT SIZE > or two to load</FONT>
<BR><FONT SIZE > it. (remainingContents)</FONT>
<BR><FONT SIZE > </FONT>
<BR><FONT SIZE > Dougie</FONT>
<BR><FONT SIZE > </FONT>
<BR><FONT SIZE > </FONT>
</P>
</BODY>
</HTML>
------_ extPart_001_01C1C388.64C2A150--