Re: Read file bug?
Re: Read file bug?
- Subject: Re: Read file bug?
- From: John Delacour <email@hidden>
- Date: Thu, 17 Apr 2003 12:07:40 +0100
- Mac-eudora-version: 6.0a15
At 10:58 am +0100 17/4/03, I wrote:
Here's a reliable way to do the thing, and I'll post a neater way in
a follow-up message.
Here's the other way to do things. I think its slower, and you would
not want to use it with large files:
set fU to "/tmp/readwrite.txt"
set f to POSIX file fU
set separator_ to ASCII character 10
repeat
try
close access f
on error
exit repeat
end try
end repeat
open for access f with write permission
set eof f to 0
repeat with i from 1 to 1000
set x to (random number from 1000 to 9999)
write "" & x & separator_ to f
end repeat
close access f
set linelist_ to read f using delimiter separator_
set counter_ to 0
repeat with line_ in linelist_
set counter_ to counter_ + 1
if line_ is greater than 8000 then
set s to "Line " & counter_ & ": " & tab & line_
log s
end if
end repeat
_______________________________________________
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.