• 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: Read lines from very large text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read lines from very large text file


  • Subject: Re: Read lines from very large text file
  • From: Seth Willits <email@hidden>
  • Date: Mon, 2 Feb 2009 13:49:46 -0800

I am wondering what the best way to read a text file, line by line, when the file size is much larger than available memory.


Use mmap. Scan through the bytes to find line ranges, and create strings from there. Make sure it's deallocated when you're done with it, then move on to the next chunk.


-- Seth Willits



_______________________________________________

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


  • Follow-Ups:
    • Re: Read lines from very large text file
      • From: Joar Wingfors <email@hidden>
References: 
 >Read lines from very large text file (From: Jacob Rhoden <email@hidden>)
 >Re: Read lines from very large text file (From: Alexander Spohr <email@hidden>)
 >Re: Read lines from very large text file (From: Jacob Rhoden <email@hidden>)
 >Re: Read lines from very large text file (From: Robert Martin <email@hidden>)

  • Prev by Date: Re: [OT] Localizing an App or Plugin
  • Next by Date: Re: NSOpenPanel - disabling the "Open" button for certain folders.
  • Previous by thread: Re: Read lines from very large text file
  • Next by thread: Re: Read lines from very large text file
  • Index(es):
    • Date
    • Thread