Bug 80030 - CSV Export of spreadsheet with \n in a cell fails to convert \n
Summary: CSV Export of spreadsheet with \n in a cell fails to convert \n
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.3.3 release
Hardware: Other All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: CSV-Export
  Show dependency treegraph
 
Reported: 2014-06-14 17:21 UTC by Chris BL
Modified: 2017-07-20 20:58 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
An ods spreadhseet, with a \n in one cell. (13.45 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-06-14 17:21 UTC, Chris BL
Details
Export plus import options (201.07 KB, image/png)
2014-06-14 19:38 UTC, m_a_riosv
Details
Search and replace for new lines (59.44 KB, image/png)
2014-06-14 20:48 UTC, m_a_riosv
Details
excel warning (11.76 KB, image/png)
2014-11-28 18:38 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris BL 2014-06-14 17:21:38 UTC
Created attachment 101056 [details]
An ods spreadhseet, with a \n in one cell.

Problem description: 

Steps to reproduce:
1. Load attached sample file. It has a paragraph as one cell
2. export to CSV

Current behavior:
Does not give option to replace '\n' in content with something else. As a result, it produces an invalid CSV; ie one line is split into two.
Expected behavior:
This may be a feature request: ie, one way to read this bug is that it ought to give an option (but not necessarily enforce) translation of '\n' to another character.
Comment 1 m_a_riosv 2014-06-14 19:38:46 UTC
Created attachment 101062 [details]
Export plus import options

Hi Chris, thanks for reporting.

Works for me with:
Win7x64 Ultimate
Version: 4.2.3.3 Id. Build: 882f8a0a489bc99a9e60c7905a60226254cb6ff0

When saving you can select to edit filter settings.
And when opening you can set up import options.
Look at mine in the attached image file.
Comment 2 Chris BL 2014-06-14 19:56:02 UTC
(In reply to comment #1)

My complaint is about the export. If I'm importing it back into LibreOffice, it figures out the \n inside " " should not mean a newline.
But for other csv readers, it is very confusing for a row to be split with a newline. It would be very nice if there was an option to replace certain characters (the separator character, maybe, but certainly newlines) during the export.
Comment 3 m_a_riosv 2014-06-14 20:48:24 UTC
Created attachment 101065 [details]
Search and replace for new lines

It's possible to do it before export with Find&Replace.

And as you want a new option, please change the importance from normal to enhancement.
Comment 4 raal 2014-11-28 18:38:01 UTC
Setting as new enhancement. Warn user as excel do this. Maybe add option to csv filter settings, but you can change \n  with search&replace. But user need to know that problem, so warning is needed.
Comment 5 raal 2014-11-28 18:38:40 UTC
Created attachment 110188 [details]
excel warning