I need to create a big table to csv file and compress it.
I can create the csv file like this: Xcode - Create csv/spreadsheet file
It is possible compress it with GZIP?
Thanks for all.
Best regards.
I need to create a big table to csv file and compress it.
I can create the csv file like this: Xcode - Create csv/spreadsheet file
It is possible compress it with GZIP?
Thanks for all.
Best regards.
I recommend you use SSZipArchive: https://github.com/soffes/ssziparchive
Then you can do:
NSString *content = @"1,2,3"
NSString *path = [NSTemporaryDirectory() stringByAppendingPathComponent:@"somefile.zip"];
SSZipArchive *zip = [[SSZipArchive alloc] initWithPath:path];
[zip open];
[zip writeData:[content dataUsingEncoding:NSUTF8StringEncoding] filename:@"data.csv"];
[zip close];
That will produce a zip file named "somefile.zip" in the temporary directory, containing one file inside named "data.csv"