Re: Determining item number matching "x" in a list
Re: Determining item number matching "x" in a list
- Subject: Re: Determining item number matching "x" in a list
- From: Steve Cunningham <email@hidden>
- Date: Fri, 14 Mar 2003 10:57:52 -0500
>
This script writes 32000 random ascii characters to a file. It then
>
loops through every character (line) and reports the index in the
>
list of every "a" it finds.
>
>
The second loop takes about half a second on my machine, or 19
>
seconds if I loop though a million items.
>
>
do shell script "perl -e '
>
$f = qq~/tmp/junk.txt~ ;
>
open F, qq~>$f~ ;
>
for (1..32000) {
>
$_ = 33 + int rand(223) ; print F chr() .$/ }'"
>
do shell script "perl -e '
>
$f = qq~/tmp/junk.txt~ ; open F, qq~$f~ ;
>
for (<F>) {
>
$i++ ;
>
/a/ and print qq~$i$/~ }'"
John, that looks interesting. Unfortunately, I'm an OS 9 Luddite and
can't use it :-)
Steve
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.