Load remote csv into CHCSVParser
Posted
by
Matt
on Stack Overflow
See other posts from Stack Overflow
or by Matt
Published on 2011-01-08T22:10:08Z
Indexed on
2011/01/09
17:53 UTC
Read the original article
Hit count: 329
Hey guys. I'm using Dave DeLong's CHCSVParser to parse a csv. I can parse the csv locally, but I cannot get it load a remote csv file. I have been staring at my MacBook way too long today and the answer is right in front of me. Here's my code:
NSString *urlStr = [[NSString alloc] initWithFormat:@"http://www.somewhere.com/LunchSpecials.csv"];
NSURL *lunchFileURL = [NSURL URLWithString:urlStr];
NSStringEncoding encoding = 0;
CHCSVParser *p = [[CHCSVParser alloc] initWithContentsOfCSVFile:[lunchFileURL path] usedEncoding:&encoding error:nil];
[p setParserDelegate:self];
[p parse];
[p release];
Thanks for any help that someone can give me.
© Stack Overflow or respective owner