Delete lines in files (text files)

Randall Lee Reetz randall at randallreetz.com
Thu Jan 17 14:37:05 EST 2008


Wow, i gave the supercard syntax, lots more verbose, (better question: how do you delete a line of script?).

randall

-----Original Message-----
From: "Devin Asay" <devin_asay at byu.edu>
To: "How to use Revolution" <use-revolution at lists.runrev.com>
Sent: 1/17/2008 11:25 AM
Subject: Re: Delete lines in files (text files)


On Jan 17, 2008, at 12:05 PM, Till Bandi wrote:

> Hi all
>
> is there a way to delete lines in a text file from Revoution? - i  
> did not see how this can be done but probably it is very simple.

Till,

You have to read it in then write it back out. You can do it in one  
line like this (assume you want to delete the first line):

put line 2 to -1 of url "file:/path/to/file.txt" into url "file:/path/ 
to/file.txt"

Just modify the range of lines you want to have in the final file.

HTH

Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution





More information about the use-livecode mailing list