• 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: Slice a .txt file in lines
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slice a .txt file in lines


  • Subject: Re: Slice a .txt file in lines
  • From: Sean Murphy <email@hidden>
  • Date: Tue, 20 Jun 2006 13:44:46 -0400


On Jun 20, 2006, at 11:48 AM, Douglas Davidson wrote:

This code assumes that the file uses a single line terminator consistently throughout. Andreas' method will use whatever terminators occur in the file.

One other note is that there are two sets of methods: one that uses the word "line", and another that uses the word "paragraph". The distinction is because there are line separators that are not paragraph separators, U+0085 NEXT LINE and U+2028 LINE SEPARATOR. This distinction may or may not be important depending on what you are trying to do.

On Jun 20, 2006, at 11:44 AM, Andreas Mayer wrote:

This assumes that there is only one type of line ending character in a single file.
I'm not sure this assumption is necessarily true.

Thank you both Douglas and Andreas. I'm glad I decided to post my code, and will keep its limitations in mind (and take this as a reminder to write more defensively, minus assumptions). Nevertheless, the text files my program is processing are consistent with one line terminator, and I guess I just modeled my code with that in mind.


Thanks again for taking the time to point those facts out.

-Murph
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Slice a .txt file in lines
      • From: Neto <email@hidden>
References: 
 >Slice a .txt file in lines (From: Neto <email@hidden>)
 >Re: Slice a .txt file in lines (From: Ben Lachman <email@hidden>)
 >Re: Slice a .txt file in lines (From: Andreas Mayer <email@hidden>)
 >Re: Slice a .txt file in lines (From: Sean Murphy <email@hidden>)
 >Re: Slice a .txt file in lines (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: NSDocument with fixed/auto-generated filename
  • Next by Date: Re: NSComboBox Delegates
  • Previous by thread: Re: Slice a .txt file in lines
  • Next by thread: Re: Slice a .txt file in lines
  • Index(es):
    • Date
    • Thread