Re: Read lines from very large text file
Re: Read lines from very large text file
- Subject: Re: Read lines from very large text file
- From: Clark Cox <email@hidden>
- Date: Sat, 7 Feb 2009 11:12:13 -0800
On Sat, Feb 7, 2009 at 10:27 AM, Steve Sisak <email@hidden> wrote:
> At 9:46 AM -0800 2/7/09, Joar Wingfors wrote:
>>
>> On Feb 7, 2009, at 6:55 AM, Steve Sisak wrote:
>>>
>>> Umm, unless I'm totally missing something, what's wrong with fopen() and
>>> fgets(), possibly followed with [NSString stringWithCString] on each line?
>>
>> What's wrong is that they won't allow you to specify the text encoding to
>> use. The same thing is true for the *deprecated* method
>> "+stringWithCString:" by the way.
>
> The OP specified he was working with ASCII logfiles before the conversation
> went off into the weeds on text encodings:
If the file is truly ASCII, then use NSASCIIStringEncoding. In this
day and age, there is *never* a good reason to use +stringWithCString:
or -initWithCString:.
--
Clark S. Cox III
email@hidden
_______________________________________________
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:
This email sent to email@hidden