Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7542955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:18:11+00:00 2026-05-30T08:18:11+00:00

I have a large text resource in my bundle. It’s a CSV containing lines

  • 0

I have a large text resource in my bundle. It’s a CSV containing lines like

0,1,100,2.2345

It’s over 9MB. What’s the best way to open and sequentially read it in so I can do something like:

myObject->initData(col0, col1, col2, col3);

(Which just stuffs the float value into one of a number of multidimensional arrays indexed by the integers in the file.)

I tried reading it into a string using [NSString stringWithContentsOfFile:] and using an NSScanner to loop over it, but I don’t want to double up my memory usage, even temporarily. It was also quite slow.

What’s the best way to do this?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T08:18:13+00:00Added an answer on May 30, 2026 at 8:18 am

    You can use NSFileHandle or C APIs to read incrementally, or you can use mmap with NSData.

    The remainder is basic cstring buffer handling, or you could use NSString line-by-line.

    Your life may be easier if you can export it as a sequence of binary floats, rather than CSV.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a a large text file (over 70mb) and need to count the
I have a large number of text files (1000+) each containing an article from
I have two large (~100 GB) text files that must be iterated through simultaneously.
I have a large text file that reads like Kyle 40 Greg 91 Reggie
I have a large text template which needs tokenized sections replaced by other text.
I have a large text file I am reading from and I need to
I have a rather large text file that has a bunch of missing newlines,
I have two (very large) text files. What is the fastest way - in
I have a large amount of text in a UITextView. I want to let
I have a large body of text which has several sentences wrapped in yada

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.