Reading files
Reading files
- Subject: Reading files
- From: Malcolm Fitzgerald <email@hidden>
- Date: Wed, 19 Oct 2005 18:19:29 +1000
Reading every line of a long file takes a long time with applescript. I
have a short list of line numbers that I want to read from a long file.
This is what I'm doing:
-- read the file
-- this takes a minute or more on /usr/share/dict/web2
set fRef to open for access POSIX file f
try
-- we have a list of line numbers to be read from a long file
repeat with i from 1 to length of lineNumbers
repeat (item i of cIndex) times -- skip this number of lines
read fRef before cr
end repeat
read fRef before cr
set end of wordList to result
end repeat
close access fRef
on error
close access fRef
end try
How can I improve this?
Malcolm Fitzgerald ph: 02 93180877
Database Manager fax: 02 93180530
The Australian Society of Authors www.asauthors.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden