I want to export data from my application into a csv file.
I found CHCSVParser by Dave Delong
https://github.com/davedelong/CHCSVParser
I created a test project, imported CHCSVWriter and wrote this:
CHCSVWriter * csvWriter = [[CHCSVWriter alloc] initWithCSVFile:@"~/testfile.csv" atomic:NO];
[csvWriter writeField:[NSString stringWithFormat:@"One"]];
[csvWriter writeLine];
[csvWriter writeField:[NSString stringWithFormat:@"Two"]];
[csvWriter writeLine];
[csvWriter closeFile];
[csvWriter release];
But I get no testfile.csv in the Finder 🙁
What am I doing wrong?
You will need to expand the
~for this to work. You can either update the parser to handle the~for you or you can initialize the parser like this,