CSV Separator

Hi,


I’m working on a C# project with Visual STudio 2008, and currently we are using Aspose.Cells.dll 6.0.
When saving a CSV file, I would like to change the separator (e.g. from “,” to “;”).
How can I do this? I was expecting something like this:

>>>
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook();
Aspose.Cells.CsvSaveOptions options = new Aspose.Cells.CsvSaveOptions();
options.Separator = (char)59;
options.SaveFormat = Aspose.Cells.SaveFormat.CSV;
wb.Save(fileName, options);
<<<

… but I cannot find any Aspose.Cells.CsvSaveOptions …

Thanks.
Massimo

Hi,


Please check if you have TxtSaveOptions class with Aspose.Cells for .NET v6.0.0 (I am not sure about it as you are using older version). This class is there in our recent/later versions which works fine using the lines of code:
e.g
//…
TxtSaveOptions options = new TxtSaveOptions(SaveFormat.CSV);
//Specify the separator
options.Separator = Convert.ToChar(";");

If you do not find this attribute in the class in your older version, I am afraid you have to upgrade to and use our latest version (v7.3.4.(latest)).

Thank you.

Hi,
I am using Aspose.cells. I have tried the csv import and the workbook is not seperating the headers column with “;” semicolon delimiter string. but it accepts and seperate the columns perfectly with “,” comma delimiter string. The thing of work is to import the CSV and assign to the datatable (vb.net)… I am using aspose.cells version (5.0.0). Also After the workbook opening the file,

  • Dim cells As Cells = wb.Worksheets(0).Cells*

the maximumcolumns count was zero.

@arunkumaarcn,

Well, since you are using some older version of the product, so we are not sure it there was some issue in your version of not. Neither we can evaluate your issue in older version or fix issues (if any). The fixes are based on latest APIs set only. We recommend you to kindly upgrade to latest version/fix: e.g Aspose.Cells for .NET v18.3.x. You may try the following sample code as mentioned above:
e.g
Sample code:

Dim options as TxtSaveOptions  New TxtSaveOptions(SaveFormat.CSV)

//Specify the separator
options.Separator = Convert.ToChar(";")

Dim workbook as Workbook = New Workbook(strFilePath, options) 

Regarding your maximum count issue, try using latest version/fix. If you still find this issue original issue with v18.3.x, kindly do provide your template CSV file and sample code (runnable) to reproduce the issue on our end, we will check it soon.

@Amjad_Sahi,

Thanks for the Response will come back to you if any.

Thanks,
ArunkumaarCN