How to read a CSV file using iOS

后端 未结 2 1519
-上瘾入骨i
-上瘾入骨i 2021-01-13 04:41

I have to develop an iOS application that can read the data from a CSV file hosted on a domain. Is there any standard APIs that can help me to do this? I don\'t need to down

相关标签:
2条回答
  • 2021-01-13 05:25

    You will have to download the file, that is the only way to get it from the remote host to your device. A CSV File is a text file with data separated by a comma(','). Download the file from the the remote host, read the file line by line, split the line string that was read from the file;

    For example:

    1,2,3,4,1,2,3 ...Line 1
    

    Split using ',' as a delimiter and add the split values into an array, the result will be:

    array_line_one = {1,2,3,4,1,2,3};
    
    0 讨论(0)
  • 2021-01-13 05:41

    I recommend Dave DeLong's CHCSVParser library for parsing.

    0 讨论(0)
提交回复
热议问题