Re: Text file reading...
Re: Text file reading...
- Subject: Re: Text file reading...
- From: Paul Berkowitz <email@hidden>
- Date: Sat, 04 Jan 2003 16:54:28 -0800
On 1/4/03 3:53 PM, "David Crowe" <email@hidden> wrote:
>
I need a script that will read text files that are either delimited
>
by 'return' characters or line feed. I won't know ahead which is
>
which.
>
>
Is there a way to do this in AppleScript?
>
>
Currently, I'm using:
>
>
read FileRef before return
>
set r to read theFile
set p to paragraph 1 of r
or
set theLines to paragraphs of r
That works for both CR and LF in all string files. If they might be Unicode,
you need AS 1.9.1 in OS 10.2.3, since it didn't work for Unicode LF in
earlier versions (it did work doe Unicode CR).
If you're going to use paragraphs of r, you also need a routine in case
there are more than 4060.
>
--
Paul Berkowitz
_______________________________________________
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.