Re: How to use delimiters in Standard Additions file read/write commands?
Re: How to use delimiters in Standard Additions file read/write commands?
- Subject: Re: How to use delimiters in Standard Additions file read/write commands?
- From: Devon and Cornwall <email@hidden>
- Date: Sun, 18 Mar 2001 16:41:46 -0800
At 9:37 AM -0800 3/18/01, Devon and Cornwall wrote:
>
set thefile to choose file
>
set filRef to open for access thefile
>
set thelist to read filRef using delimiter {" "}
>
close access filRef
>
thelist
>
>
or (a little faster)
>
>
set thefile to choose file
>
set filRef to open for access thefile
>
set thelist to words of (read filRef)
>
close access filRef
>
thelist
The second construction is NOT faster. In fact, it takes twice the
time of the first!
Also, while on the subject, changing the line in #1 to read:
set thelist to read filRef as list using delimiter {" "}
returns an array, rather than a simple list, and cuts the
speed in half!
{{"If"}, {"this"}, {"next"}, {"AppleScript"}, {"wasn't"}, {"so"}, {"much"}, {"fun"}}
Devon and Cornwall