Counting number of lines in CSV file without loading into memory

I have a CSV file that is extremely large, roughly 50k+ lines. I use CHCSVParser to parse it all line by line which works fine. I would like to display some type of progress to the user as the data is parsed and added into CoreData. If I know the number of lines I can just show numLinesParsed/totalLines. I was wondering if there was a fast way to count the number of lines in the CSV file without : 1. Loading it all into memory 2. Taking more than a few seconds I don't know if I should try do this Objective C or if doing it in straight C would be better.
what about reading file in batches?

以上就是Counting number of lines in CSV file without loading into memory的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏