Bug 116811 - CSV file with 00 (NUL) bytes does not import as multiple lines
Summary: CSV file with 00 (NUL) bytes does not import as multiple lines
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CSV-Import
  Show dependency treegraph
 
Reported: 2018-04-05 03:33 UTC by Tim Richardson
Modified: 2021-02-22 17:55 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
example csv (796 bytes, text/csv)
2018-04-05 03:33 UTC, Tim Richardson
Details
excel's rewrite of the CSV file, which now imports in LO (545 bytes, text/csv)
2018-04-05 04:00 UTC, Tim Richardson
Details
00 bytes replaced (796 bytes, text/csv)
2018-04-05 04:01 UTC, Tim Richardson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Richardson 2018-04-05 03:33:46 UTC
Created attachment 141103 [details]
example csv

The attached is a csv file generated from an old dos app. It is CSV but it imports into LibreOffice as one line, the newlines are not being recognised.
Comment 1 Tim Richardson 2018-04-05 03:56:21 UTC
Note, this file can be imported successfully by Excel. After saving it as csv in Excel, it works. Excel strips out all the 00 byte values, perhaps they are confusing LibreOffice?
Comment 2 Tim Richardson 2018-04-05 04:00:08 UTC
Created attachment 141104 [details]
excel's rewrite of the CSV file, which now imports in LO

This attachment is the csv generated after importing the original file in Excel and saving it again. The quoting of text fields has changed, but it is the 00 bytes which cause the problem
Comment 3 Tim Richardson 2018-04-05 04:01:09 UTC
Created attachment 141105 [details]
00 bytes replaced

I used a hexeditor to replace the 00 bytes with 0x20
Now it imports into LO. So the 00 bytes are definitely the problem.
Comment 4 Laurent Balland 2018-04-14 16:19:15 UTC
I CAN reproduce with:
- Version: 5.4.7.1
Build ID: ef425abf896c652d177000096228d1dbcfe9c7af
CPU threads: 8; OS: Linux 4.13; UI render: default; VCL: gtk2; 
Locale: fr-FR (fr_FR.UTF-8); Calc: group
- Version: 5.2.7.2
Build ID: 2b7f1e640c46ceb28adf43ee075a6e8b8439ed10
Threads CPU : 8; Version de l'OS :Linux 4.13; UI Render : par défaut; VCL : gtk2; 
Locale : fr-FR (fr_FR.UTF-8); Calc: group
Comment 5 QA Administrators 2021-02-04 04:25:46 UTC Comment hidden (obsolete)
Comment 6 Roman Kuznetsov 2021-02-22 17:55:02 UTC
LO Calc opens that example CSV with three rows if you select ' instead " in "String delimiter" drop-down list in "Text Import" dialog.

I think we can close it as WFM.