• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Text file reading...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Text file reading... (From: David Crowe <email@hidden>)

  • Prev by Date: Text file reading...
  • Next by Date: Re: Sending mail via Mail.app
  • Previous by thread: Text file reading...
  • Next by thread: Re: Text file reading...
  • Index(es):
    • Date
    • Thread