+ (NSArray *)arrayWithContentOfSimpleCsvFile:(NSString *)path {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString * content = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
NSArray * rows = [content componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
[content release];
NSUInteger rowsCount = rows.count;
NSMutableArray * result = [[NSMutableArray alloc] initWithCapacity:rowsCount];
for (NSInteger idx = 0; idx < rowsCount; ++idx) {
NSString * row = [rows objectAtIndex:idx];
if ([row length] > 0) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSArray * columns = [row componentsSeparatedByCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@","]];
[result addObject:columns];
[pool drain];
}
}
[pool drain];
[result autorelease];
return result;
}