We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

CSV delimiter

With machine’s regional setting to Italian, the saved CSV will use semicolon as separator rather than comma.
But changing List Separator has no impact on the saved CSV’s delimiter, is this a bug?

Workbook workbook = new Workbook();
workbook.open(“test.csv”);
workbook.save(“test_new.csv”, com.aspose.cells.FileFormatType.CSV);

our Aspose.cells version is 2.5.3.

And if Aspose chooses CSV’s separator depending on regional language setting, it should also rely on it to open a CSVfile. But when opening CSV, it only handles comma separator by default.

Thanks for help

Hi,

If you want to save the csv file using a ; separator, then you can use the following code.

I found, it is working fine with the latest version:
Aspose.Cells
for Java v7.0.4.5


I have also attached the output file.

Java


String filePath =“F:\Shak-Data-RW\Downloads\test.csv”;


Workbook workbook = new Workbook(filePath);


TxtSaveOptions opts = new TxtSaveOptions();

opts.setSeparator(’;’);


workbook.save(filePath + “.out.java.csv”, opts);



Many thanks for your reply.
<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>
My problem is that we’re not able to replace current v2.5.3 by latest v7.0.4.5 in our big product at this point.
Do you have any solution with <span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>v2.5.3 or <span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-ansi-language:
EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>v2.5.4?
I tried workbook.save(“test.csv”, ‘;’); it didn’t work - throws the error: java.lang.IllegalArgumentException: Invalid FileFormatType value: 124

Hi,

Use the following code with the older 2.5.X versions, it works fine as I have tested it on my end.

I am also attaching the output csv file.

Java


String filePath =“F:\Shak-Data-RW\Downloads\test\test.csv”;


Workbook workbook = new Workbook();

workbook.open(filePath);


workbook.save(filePath + “.out.csv”, ‘;’, “ASCII”);



Thanks a lot.