开发者

Objective C - Read plaintext multicolumn file into several column arrays

开发者 https://www.devze.com 2023-04-12 02:50 出处:网络
I have s开发者_如何转开发een several threads about file handling in Objective C but can\'t find a simple systematic way to do this: let\'s say you have a multicolumn data files where each x y z ... co

I have s开发者_如何转开发een several threads about file handling in Objective C but can't find a simple systematic way to do this: let's say you have a multicolumn data files where each x y z ... columns are separated by tabs. What I want to do is just converting each column to a specific array. I have almost no experience with Objective C but I do know C++.

Thank you in advance.


Use a NSString method to do this after reading it with stringWithContentsOfFile:...:

  • split it into a line-array with componentsSeperatedByString:@"\n"

  • split each line-array line with componentsSeperatedByString:@"\t"

0

精彩评论

暂无评论...
验证码 换一张
取 消