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前端其它相关文章！