NSString *path = [[NSBundle mainBundle] pathForResource:@"ECG_Data" ofType:@"csv"];
NSString *contents = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
NSArray *contentsArray = [contents componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
NSInteger idx;
for (idx = 0; idx < contentsArray.count; idx++) {
NSString* currentContent = [contentsArray objectAtIndex:idx];
NSArray* timeDataArr = [currentContent componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@","]];
}
读取简单的CSV文件
最新推荐文章于 2022-11-10 08:59:55 发布