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: glenn andreas <email@hidden>
- Date: Tue, 03 Feb 2009 08:50:13 -0600
On Feb 2, 2009, at 11:25 PM, Seth Willits wrote:
On Feb 2, 2009, at 7:50 PM, Joar Wingfors wrote:
Before opening the file, either determine, guess, or be told what
the encoding is. With that encoding, convert your delimiter string
into raw bytes, then do byte-for-byte comparison on the file to
find occurrences of that delimiter.
How do you know what delimiter string to use?
Well the original poster said he wants to read lines. So \r, \n, or
\r\n is your delimiter. It depends on your usage.
As well as unicode LINE SEPARATOR (0x2028), and PARAGRAPH SEPARATOR
(0x2029), which are recognized as line separators by NSString's
getLineStart:end:contentsEnd:forRange and friends (if the file is one
of several unicode encoding).
Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
Mad, Bad, and Dangerous to Know
_______________________________________________
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