Reading/Deleting Last Line Of File

J. Landman Gay jacque at hyperactivesw.com
Tue Feb 9 19:05:10 EST 2010


Piggy-backing here:
>>> I have a large text file (100,000,000+ records).  I need to write a
>>> utility that removes the last record of the file.  Is there anyway to
>>> just remove the last record without reading through the complete file
>>> with RunRev?

It sounds like a big file, but Rev is pretty good about managing memory 
and swapping to disk. I'd be tempted to try this and see how it works:

   delete line -1 of url ("file:mytext.txt")

Worth a test anyway. I've used it on files that were several megs in 
size without a problem, but they weren't super huge, just kinda big.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the Use-livecode mailing list