I am using spreadsheetgear to generate Tab delimited file, it works fine but the issue is if any column in datatable has value with comma("," character) then spreadsheetgear automatically surround the text with double quotes.
Is there way to not putting double quotes if the text has comma character?
Here is the code I am using to generate tab delimited file:
Dim workbook As SpreadsheetGear.IWorkbook
Dim worksheet As SpreadsheetGear.IWorksheet
workbook = SpreadsheetGear.Factory.GetWorkbook()
worksheet = workbook.Worksheets("Sheet1")
Dim cells As SpreadsheetGear.IRange
cells = worksheet.Cells
cells.CopyFromDataTable(dt, Data.SetDataFlags.None)
workbook.SaveAs(strFilePath, SpreadsheetGear.FileFormat.UnicodeText)
worksheet = Nothing
workbook.Close()
workbook = Nothing
You could loop over the text of each cell in
cells
and take out the quotes. Quotes can be placed inside (or found in) strings using a double-double-quote ("") which can look strange, but gets the job done. For example, you could use cellText.Replace("""", "") to remove quotes.