Free Support Forum - aspose.com

Aspose.Cells wrap the terms between triple double quotes

Using Aspose.Cells I need a csv file with my terms wraped between double quotes. For some reason the terms after the first column are surrounded by triple double quotes when saving my csv file, like: """term"""

This is my code:

WorkbookDesigner wd = new WorkbookDesigner();
wd.Workbook.Initialize();
Worksheet sht = wd.Workbook.Worksheets[0];
string value = "term";
value = string.Format("\"{0}\"", value);
sht.Cells[row + rowOffset, column].PutValue(value);
wd.Save(fileLoc, FileFormatType.CSV);

I'm using Aspose.Cells version 4.8.0.0

Hi,


Well, I used the following sample code, it works fine. I use our latest version/ fix Aspose.Cells for .NET v8.5.0 (you may download and try it from Downloads module), it does have the option TxtSaveOption.QuoteType (this feature available in recent versions of the product) which I set to Never, so when you open the output CSV file into Notepad, it shows “term” instead of “”“term”"" for your needs:
e.g
Sample code:

WorkbookDesigner wd = new WorkbookDesigner();
wd.Workbook.Initialize();
Worksheet sht = wd.Workbook.Worksheets[0];
string value = “term”;
value = string.Format(""{0}"", value);
sht.Cells[0,0].PutValue(value);

TxtSaveOptions options = new TxtSaveOptions(SaveFormat.CSV);
options.QuoteType = TxtValueQuoteType.Never;
wd.Workbook.Save(“e:\test2\out1.csv”, options);


And, I am afraid, as you are using some older version of the product which might not have such a feature, so you have to upgrade to latest version, there may not be any other alternative I would say.

Thank you.