davedelong/CHCSVParser

Writer create renew the file

AncAinu opened this issue · 2 comments

Maybe I just didn't find, but I want the writer to append on my actual CSV File, not create a new one each time I do : CHCSVWriter *csvWriter = [[CHCSVWriter alloc] initForWritingToCSVFile:..];

Is it possible to do it ?
Because parse all the file before writing one more line in would be extremely expensive for the purpose.
Thank for support :)

You can do this by using the other initializer on CHCSVWriter and passing in an NSOutputStream that's set to append to the file and not overwrite it. If you do this, you'll need to be sure that you're using an encoding on the file that does NOT have a BOM, or else the writer will attempt to write it again to the stream, resulting in a random BOM floating around in your file that will likely corrupt the contents.

Works ! Thank you for this awesomely quick support ^^