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

Free Support Forum - aspose.com

Can not load CSV file with "- (saved with Aspose Cells)

If a cell contains the string ", (a double quote followed by a comma), the CSV saved by Aspose.Cells is not loaded correctly by Aspose.Cells.


Config: Aspose Cell 7.0.1 for Java, jdk16, MacOS

The following code demonstrates the issue.

// Create a workbook with some example cells
Workbook original = new Workbook();
Cells originalCells = original.getWorksheets().get(0).getCells();

originalCells.get(0, 0).setValue("Option A");
originalCells.get(0, 1).setValue("Hello, World");

originalCells.get(1, 0).setValue("Option B");
originalCells.get(1, 1).setValue("Hello\" World");

originalCells.get(2, 0).setValue("Option C");
originalCells.get(2, 1).setValue("Hello");
originalCells.get(2, 2).setValue("World");

originalCells.get(3, 0).setValue("Option D");
originalCells.get(3, 1).setValue("Hello\", World");

// Save the file
original.save(file.getAbsolutePath(), SaveFormat.CSV);

// Now load the CSV file just created...
Workbook loaded = new Workbook(file.getAbsolutePath());
Cells loadedCells = loaded.getWorksheets().get(0).getCells();

assert loadedCells.get(0, 1).getStringValue().equals("Hello, World");
assert loadedCells.get(1, 1).getStringValue().equals("Hello\" World");
assert loadedCells.get(2, 1).getStringValue().equals("Hello");
assert loadedCells.get(2, 2).getStringValue().equals("World");
// The following assertion fails
assert loadedCells.get(3, 1).getStringValue().equals("Hello\", World");

The code above produces the following file:

Option A,"Hello, World",
Option B,"Hello"" World",
Option C,Hello,World
Option D,"Hello", World",

Hi,

Thanks for your reporting.

We have logged your issue in our database. We will investigate the problem and fix it and update you asap.

Hi,

We have fixed this issue. Please download: Aspose.Cells for Java v7.0.2.1

Confirmed.

Thank you.

The issues you have found earlier (filed as 31303) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as 31303) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(1)

The issues you have found earlier (filed as 31303) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.