Standard Additions 'read' command - basic questions
Standard Additions 'read' command - basic questions
- Subject: Standard Additions 'read' command - basic questions
- From: Chap Harrison <email@hidden>
- Date: Sun, 18 Jan 2004 23:35:24 -0600
Hi all,
First post to the list, first-time user of Applescript, but not a
novice programmer.
I used a Unix script to create a text file that I need to read from an
Applescript in order to add records to a Filemaker DB.
The text file consists of records, each of which contains a variable
number of fields. So far so good, with one caveat: the "fields" are
ASCII text which may contain Mac new-line characters (in fact, any
ASCII character). Therefore, I chose to delimit these fields with the
non-ASCII character 0xfe. Furthermore, since each record contains an
unknown number of fields, I must also delimit each record -- I use
0xff.
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?
If so, are there any limits as to the length of a list?
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
foo is a list containing one string, which is the contents of the
entire file, with my oddball delimiters intact.
Are 0xfe or 0xff not valid delimiters as far as AS is concerned?
Suggestions for a better approach?
Thanks,
Chap
_______________________________________________
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.