• 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... (David Crowe)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text file reading... (David Crowe)


  • Subject: Re: Text file reading... (David Crowe)
  • From: David Crowe <email@hidden>
  • Date: Sun, 5 Jan 2003 22:46:14 -0700

Thanks to Paul Berkowitz and Gary Lists for their assistance regarding reading a text file that might be delimited by either linefeeds or carriage returns.


Paul suggested reading the whole file and then reading out paragraphs, which don't care about the difference between CR and LF. That leaves the problem, however, of when the file gets too big (I presume 4060 bytes is the largest).

Gary suggested reading "to eof". I presume that this is the same thing, to read the entire file in one swoop, and then parse out the lines later.

It seems like this is the best solution. If size gets to be a problem (e.g. files larger than 4k), I can always read the file in chunks and pull lines out of the chunk as necessary, taking care to handle lines that cross chunk boundaries.

- David Crowe
_______________________________________________
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.

  • Follow-Ups:
    • Re: Text file reading... (David Crowe)
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: saving a file in GraphicConverter
  • Next by Date: Re: Old Topic Revisited, Bounding Rectangles +
  • Previous by thread: Re: applescript-users digest, Vol 3 #1199 - 7 msgs
  • Next by thread: Re: Text file reading... (David Crowe)
  • Index(es):
    • Date
    • Thread