Reading a (BIG) text file one line at a time

xbury.cs at clearstream.com xbury.cs at clearstream.com
Tue Nov 23 10:21:21 EST 2004


Frank,

Thanks! I got it mixed up again!
Sorry, it was a bit too early in the morning...

Regards,
---------------------=---------------------
Xavier Bury
Clearstream Services
TNS NT LAN Server
ext 36465
Voice: +352 4656 43 6465
Fax: +352 4656 493 6465




"Frank D. Engel, Jr." <fde101 at fjrhome.net>
Sent by: use-revolution-bounces at lists.runrev.com
23.11.2004 16:08
Please respond to How to use Revolution

 
        To:     x at monsieurx.com, How to use Revolution <use-revolution at lists.runrev.com>
        cc:     (bcc: Xavier Bury/CLEARSTREAM/GDB)
        Subject:        Re: Reading a (BIG) text file one line at a time

.

Bug #2431 does not exist.  Did you mean 2341 by any chance?

On Nov 23, 2004, at 12:23 AM, MisterX wrote:

> I have a freeware stack with all the read and write files examples with
> buffered reading and buffer block positioning/navigation included... 
> There's
> also more features like file info, hex or text display among others...
>
> This is much much faster than reading line by line and wont abuse 
> RAM...
>
> Unfortunately, all my development is blocked by bug 2431. If you vote 
> for
> it, I will make this stack available again tonite.
>
> cheers
> Xavier, still blocked
> --
>
>
>> -----Original Message-----
>> From: use-revolution-bounces at lists.runrev.com
>> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of
>> Gordon Tillman
>> Sent: Monday, November 22, 2004 21:14
>> To: Rob Beynon; How to use Revolution
>> Subject: Re: Reading a (BIG) text file one line at a time
>>
>> Hi Rob,
>>
>> On Nov 22, 2004, at 14:05, Rob Beynon wrote:
>>
>>> Greetings all,
>>> I have failed to discover how to read a file one line at a
>> time. The
>>> file is a text file, and is large (84MB) but I need to
>> process it on a
>>> line by line basis, rather than read the whole file into a
>> field (not
>>> even sure I can!).
>>>
>>> I thought of
>>>
>>> read from myFile until EOF for one line
>>>
>>> but that doesn't work
>>>
>>> Help would be greatly appreciated here! Would you be good enough to
>>> mail to my work address, as I have yet to work out how to
>> access the
>>> list effectively
>>
>> Once you open your file you can use:
>>
>> read from file "your_file" for 1 line
>>
>> The line that is read is put into the "it" variable When you
>> hit the end of the file then "the result" will no longer be
>> empty.  It will have "eof" in it.
>>
>> For example, assuming the file tFile is open:
>>
>> repeat forever
>>      read from file tFile for 1 line
>>      put it into tLine
>>      put the result into tRes
>>
>>      if tRes is not empty then exit repeat
>>
>>      -- do something with tLine
>> end repeat
>>
>> close file tFile
>>
>>
>> --gordon
>>
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
-----------------------------------------------------------
Frank D. Engel, Jr.  <fde101 at fjrhome.net>

$ ln -s /usr/share/kjvbible /usr/manual
$ true | cat /usr/manual | grep "John 3:16"
John 3:16 For God so loved the world, that he gave his only begotten 
Son, that whosoever believeth in him should not perish, but have 
everlasting life.
$



___________________________________________________________
$0 Web Hosting with up to 120MB web space, 1000 MB Transfer
10 Personalized POP and Web E-mail Accounts, and much more.
Signup at www.doteasy.com

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
http://lists.runrev.com/mailman/listinfo/use-revolution





-----------------------------------------
Visit us at http://www.clearstream.com
IMPORTANT MESSAGE    Internet communications are not secure and therefore
Clearstream International does not accept legal responsibility for the
contents of this message.    The information contained in this e-mail is
confidential and may be legally privileged. It is intended solely for the
addressee. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. Any views expressed in this e-mail are
those of the individual sender, except where the sender specifically states
them to be the views of Clearstream International or of any of its
affiliates or subsidiaries.    END OF DISCLAIMER


More information about the use-livecode mailing list