Re: Standard Additions 'read' command - basic questions
Re: Standard Additions 'read' command - basic questions
- Subject: Re: Standard Additions 'read' command - basic questions
- From: Christopher Stone <email@hidden>
- Date: Mon, 19 Jan 2004 01:51:30 -0600
Hello Chap,
At 23:35 -0600 01/18/2004, Chap Harrison wrought:
The first thing I noticed was that a single invocation of 'read' appears
to return the entire *file* as a list!! Is this how 'read' is supposed
to work?
Interesting. It doesn't happen for me using simple text records and your
delimiters (on Panther).
If so, are there any limits as to the length of a list?
Lists can be very, very large on Panther.
The second problem was that 'read' doesn't care for my high-end delimiters:
set foo to (read fid using delimiter (ASCII character 254)) -- also tried 255
A NULL character will work fine for the record delimiter.
Are 0xfe or 0xff not valid delimiters as far as AS is concerned?
Evidently not.
The Satimage osax (or Smile) will handle your delimiters just fine.
set fl to alias "Lao-Tzu:Users:chris:Desktop:testRead"
set delim to ASCII character 255
set findSpec to "[^" & delim & "]+"
try
set RecordList to find text findSpec in fl with regexp, all
occurrences and string result without case sensitive
on error
set RecordList to false
end try
How big a file are you processing?
Chris
_______________________________________________
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.