I have an issue where I have a .csv file and I need the string values to be enclosed in doubled quotes. I tried this:
cells[row, i++].PutValue(""" + record.GetDataItemString(SharedConstants.JobField.ParticipantNumber) + “”");
But it would appear your library encloses the value in 3 sets of double quotes so I get “”“MyValue”"" instead of “MyValue”. Can you please tell me what I would need to change to make this work correctly? Thanks
Hi,
Please try to set QuoteType to appropriate value for TxtSaveOptions, see the sample code below for your reference:
e.g
Sample code:
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
string value = “test”;
value = string.Format(""{0}"", value);
worksheet.Cells[0, 0].PutValue(value);
TxtSaveOptions options = new TxtSaveOptions(SaveFormat.CSV);
options.QuoteType = TxtValueQuoteType.Never;
workbook.Save(“e:\test2\out1.csv”, options);
Hope, this helps a bit.
Thank you.
Hi,
Good to know that your issue is sorted out by the suggested code. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.
Thank you.