CSV write/read does not 'round trip' for some inputs

While testing our usage of the Aspose.Cells CSV support, I found that some data appears to be written correctly but not read back correctly.


I populate a DataTable with 3 rows using the following strings (these are C# strings so I’m writing them with C#-style escape sequences here). Notice how the values in the last row contain both quotes and commas because I wanted to test whether the parser could handle user input that contains quotes and commas.

“ItemB ColumnA Row0”, “ItemB ColumnB Row0”, “ItemB ColumnC Row0"

“ItemB ColumnA Row1”, “ItemB ColumnB Row1”, “ItemB ColumnC Row1"

”“ItemB”, “ColumnA”, “Row2"”, ““ItemB”, “ColumnB”, “Row2"”, ““ItemB”, “ColumnC”, “Row2"“

When I use Aspose.Cells to write this to a CSV, the file content looks good and uses CSV-style escape sequences (notice the triple-quotes within the last row):

ColumnA,ColumnB,ColumnC
ItemB ColumnA Row0,ItemB ColumnB Row0,ItemB ColumnC Row0
ItemB ColumnA Row1,ItemB ColumnB Row1,ItemB ColumnC Row1
"”“ItemB””, ““ColumnA””, ““Row2"””,””“ItemB””, ““ColumnB””, ““Row2"””,""“ItemB”", ““ColumnC””, "“Row2"”“

Unfortunately, the last row gets garbled when I try to read it back into a DataTable:
The first value of row 3 comes back as: ItemB”, “ColumnA”, “Row2
The second value of row 3 comes back as: ItemB”, “ColumnB”, “Row2
The third value of row 3 comes back as: ItemB”, “ColumnC”, "Row2

This differs from Excel’s correct behavior, in which:
The first value of row 3 appears as: “ItemB”, “ColumnA”, "Row2"
The second value of row 3 appears as: “ItemB”, “ColumnB”, "Row2"
The third value of row 3 appears as: “ItemB”, “ColumnC”, "Row2"

In other words, the ‘outermost’ quoting was misinterpreted during file-reading.

Hi,

Thanks for using Aspose.Cells for .NET.

Please download and try the latest version: Aspose.Cells
for .NET v7.3.0.
4
and let us know your feedback.

If the problem still occurs, then please provide us simple runnable sample project replicating your issue along with your source files.

We will look into it and help you asap.

See attached sample. The problem is still happening in the version you linked to.

Hi,


Thanks for providing the sample project.

After an initial test and by running your sample project, I can find the issue as you have pointed out. Your issue has been logged with an id: CELLSNET-40949 into our Issue tracking system. We are working on your issue to figure it out soon. Once we have any update on it, we will let you know here.

Thank you.

Hi,

Thanks for using Aspose.Cells.

We have fixed this issue.

Please download and try this fix: Aspose.Cells for .NET v7.3.0.5 and let us know your feedback.

Thank you. This version 7.3.0.5 does fix my issue. Now that it works for our needs, I will be recommending to my employer that we are finished evaluating the product and can purchase a license. Since 7.3.0.5 is not yet an official release for the public, will we have trouble applying a license to this version?

Hi,

Thanks for your feedback.

No, you will not have any trouble applying your license. This release is called Minor version or Minor release. You can use this release for your production use

The official release is called Major version or Major release.

Both minor and major releases are equally same except major release is
published with release notes and both are meant for production use.

Please see the sample release notes for Major release at the following link. I have also posted a screenshot for your reference.

Release Notes - Aspose.Cells for .NET 7.2.1


Screenshot:

Hi,


As Shakeel Faiz suggested you may use that fix v7.3.0.5 as an official release, it includes all the functionality and fixes of all the previous versions and fixes.

However, a good news for you, we are scheduled to release our next official version (i.e. v7.3.1) within a couple of days hopefully.

Thank you.

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


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