Re: Detecting new line character(s) in text file?
Subject : Re: Detecting new line character(s) in text file?
From: Shawn Erickson <email@hidden >
Date: Sat, 17 Nov 2007 15:14:43 -0800
Delivered-to: email@hidden
Delivered-to: email@hidden
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; bh=OoNKd2KDN2/HlcfEbtUWb6RyY2E3pmGVdwqTJY+52I8=; b=CTzSScX2SQCpTEkqKan23RyhRLncUdno36xYQoe5fCa3b7HRfc7bQgqu2TmyRGbyK+1eYWAeyvEF3HFhu0Jt7O2SbsZzDl8EoKfGUrrP3gaiMW9RbbjaB/1hb9x8HdwVzXGh5CdorUDxECHdV9oENcDmFQLe3HrGvOejpaxwxu4=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:cc:message-id:from:to:in-reply-to:content-type:content-transfer-encoding:mime-version:subject:date:references:x-mailer; b=XEi37B9u0vwJs61vNqzdntBnde4YA1dA27fqj/OM7wthTqRaFGGTsTNGmJfYk2sGo6lQWCKWbmQTccaFDxfQ1EhfIkCH91r/uE5vZkAlmm/6v+e7NRTjNp+XlXJjMhV0VtLkHmLMjOh5pp6JtTbvC7//ndHXy8KjRZT8kTVXpqo=
On Nov 17, 2007, at 2:51 PM, Jean-Nicolas Jolivet wrote:
My application deals with text files... each line has to be parsed
so I split it with
[str componentsSeparatedByString:@"\n"]
however..this only works if I have a text file that was saved on a
mac... Is there an easy way to determine which new line character is
used in a textfile (eighther linux, mac or win) and then use this
for parsing afterward?
What are you trying? (not how you are currently trying to do it)
Consider -[NSString getLineStart:end:contentsEnd:forRange:]
Review...
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/Reference/NSString.html#//apple_ref/doc/uid/20000154-DontLinkElementID_25
>
-Shawn
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden
This email sent to email@hidden
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.