I got a working csv attachment to an email view. The problem is, that when I open the csv on the iPhone it displays the file really nice into separate columns. But if I open it in excel it's all in one field. I need two columns how can I do that? Tried to separate fields with commas but that didn't work (obviously). The following lines are the ones that must be incorrect somehow, this is where I build my string to write to file
[csv appendFormat:@"\n\"Total # of tables: %@\",Total # of objects: %d, \n \n", filteredTables,filteredTableRows]
[csv appendFormat:@"\n\"%@\",%@,", key, value];
And this is my code (copied and seems to be standard) for the writing to file
BOOL res = [csv writeToFile:fileName atomically:YES encoding:NSUTF8StringEncoding error:&error];
if (!res) {
NSLog(@"Error %@ while writing to file %@", [error localizedDescription], fileName);
}
Why is it not working the way I want it to, and how do I get the string to separate into different columns? Thanks!