I am working in .Net 4.7.2. We have List of objects say MyObject which is to be converted to csv single file. Currently using below code i use to create HUGE csv file ( 10GB and onwards).
using (var writ = new StreamWriter(fileStream, Encoding.UTF8))
{
using (var csvWrit = new CsvWriter(writ))
{
//logic
csvWrit.NextRecord();
}
}
ZipFile.CreateFromDirectory(<sourcefileName>, <destFileName>);
Now I need to create zip of these HUGE file. I found ZipFile.CreateFromDirectory in C#. After csv is created I call ZipFile.CreateFromDirectory to create zip file.
My Question Should I continue to first create the csv and then zip OR Any other efficient way to do this?