Bug 96561 - Fails to import CSV file created with CsvHelper
Summary: Fails to import CSV file created with CsvHelper
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.0.3.2 release
Hardware: All All
: low minor
Assignee: Eike Rathke
URL:
Whiteboard: target:7.3.0 target:7.2.1 target:7.1.6
Keywords:
Depends on:
Blocks: CSV-Import
  Show dependency treegraph
 
Reported: 2015-12-17 16:02 UTC by f.ricolfe
Modified: 2021-08-18 13:37 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Sample file y cant import with LibreOffice Calc (767 bytes, application/vnd.ms-excel)
2015-12-17 16:02 UTC, f.ricolfe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description f.ricolfe 2015-12-17 16:02:59 UTC
Created attachment 121369 [details]
Sample file y cant import with LibreOffice Calc

Error importing csv, if some field contains \0 characteres.

In the sample file, the row 7 (8 if including header), contains \0 characters at end of first field.

This is nos iterpreted properly, and the rows dont match.

This file, import properly in Excel (windows and mac), and in C# program, using CsvHelper (nuget package)

The sample file is generated using CsvHelper
Comment 1 Andreas B. 2015-12-19 12:48:14 UTC
I checked it with LibreOffice 5.0.3.2 on Linux.

Confirmed.
At the line with the \0, the \n\r is interpreted, as would it be within qoutes, and kept in the cell E7, instead of creating a new row. (For this cell are no quotes.)

If I remove the \0, the file is displayed correctly.

I looked at https://tools.ietf.org/html/rfc4180

It seems this CSV file is valid.
Comment 2 QA Administrators 2017-01-03 19:51:00 UTC Comment hidden (obsolete)
Comment 3 vihsa 2017-06-01 08:14:28 UTC
reproducible with lo viewer version: 5.5.0.0.alpha0+ / build id : ec79f34 / android 5.1
Comment 4 QA Administrators 2018-07-21 02:39:36 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2020-07-21 03:47:31 UTC Comment hidden (obsolete)
Comment 6 Commit Notification 2021-08-16 21:32:26 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7bd03074ae7362d8fffe5182529626a0b43a0ed1

Resolves: tdf#96561 Include embedded null-characters while assembling CSV line

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Eike Rathke 2021-08-16 21:34:03 UTC
Pending review
https://gerrit.libreoffice.org/c/core/+/120451 for 7-2
https://gerrit.libreoffice.org/c/core/+/120572 for 7-1
Comment 8 Commit Notification 2021-08-17 08:52:47 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/d6808f6ba03f74f99759e8d59ac0a04fcc9c6dd8

Resolves: tdf#96561 Include embedded null-characters while assembling CSV line

It will be available in 7.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2021-08-17 08:54:00 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/c061dc196a30dc14acba5aba5bf538edb3d4fcc4

Resolves: tdf#96561 Include embedded null-characters while assembling CSV line

It will be available in 7.1.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Timur 2021-08-17 09:20:42 UTC
It looks as in MSO now. I set Verified.
Comment 11 Commit Notification 2021-08-18 13:37:54 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/90cd3e13f1e4eeaf65cab75e5409169ae7e642ab

tdf#96561: sc: Add UItest

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.