Bug 131917 - Export of text introduces line break
Summary: Export of text introduces line break
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.5.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-06 00:28 UTC by Paul Mirowsky
Modified: 2022-04-25 03:27 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Resulting file with line breaks (3.60 KB, text/plain)
2020-04-06 00:30 UTC, Paul Mirowsky
Details
Original file that is modified in Writer (1.65 KB, text/csv)
2020-04-20 14:00 UTC, Paul Mirowsky
Details
CSV with CR chars removed (1.59 KB, text/csv)
2020-08-28 14:14 UTC, Buovjaga
Details
textChooseEncoding.png: File - Save As - "Text - Choose encoding" (17.19 KB, image/png)
2021-09-25 06:35 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Mirowsky 2020-04-06 00:28:09 UTC
Description:
On export of a Writer imported CSV file, Writer adds a line break or some other aberration causing incomplete to end of line export. The lines exported are broken at position 63. 

Steps to Reproduce:
1. I open a CSV file with Writer, modify many lines that are like first two below.
From...
 Date  ;  Time ;Ions Avg
2020-04-03;4:30:00 PM; -924509
2. Modified to...
ID;Model;Tube;Position;Dates;Times;Ions;Selection;Series;Settings
;1-1629-0001-1;1-1617-0003-8;1.1;2020-04-03;4:30:00 PM; -924509;;145;100

3. On exporting to file type TXT and opening with text editor results in...
ID;Model;Tube;Position;Dates;Times;Ions;Selection;Series;Settings
;1-1629-0001-1;1-1617-0003-8;1.1;2020-04-03;4:30:00 PM; -924509
;;145;100

4. It generates some form of line return at position 63.
When re-opening with Writer, it display first 2 lines correctly, but all other data lines after do not display.


Actual Results:
Re-import of text data into Writer in CSV format loses all other lines after line 2.
Opening exported CSV in other editor make line break at position 63.

Expected Results:
On export and re-opening of TXT document, all lines should be proper length without inserted line break or aberration.


Reproducible: Always


User Profile Reset: No



Additional Info:
Ubuntu 18.04 editor = Gedit
Comment 1 Paul Mirowsky 2020-04-06 00:30:43 UTC
Created attachment 159352 [details]
Resulting file with line breaks
Comment 2 Paul Mirowsky 2020-04-06 16:29:45 UTC
I have imported the processed Writer document into Calc and then exported in CSV format which resulted in correct number of characters per line when opened with Gedit or Writer.
Calc strip spaces on export of CSV formatted document and Writer does not.
What is unknown is which is proper. Assuming Calc does the correct action, Writer should be changed similarly.
Comment 3 Jean-Baptiste Faure 2020-04-19 16:41:54 UTC
Please, could you attach initial CSV file.

Status set to NEEDINFO, please set it back to UNCONFIRMED once requested
information is provided.

Best regards. JBF
Comment 4 Paul Mirowsky 2020-04-20 14:00:06 UTC
Created attachment 159762 [details]
Original file that is modified in Writer
Comment 5 QA Administrators 2020-04-21 03:38:35 UTC Comment hidden (obsolete)
Comment 6 Paul Mirowsky 2020-04-21 16:27:11 UTC
Set UNCONFIRMED
Comment 7 Jean-Baptiste Faure 2020-04-25 21:08:28 UTC
(In reply to Paul Mirowsky from comment #4)
> Created attachment 159762 [details]
> Original file that is modified in Writer

Thank you for the file. I do not reproduce the line break problem you described.
That said it is possible that I did not do exactly what you did. Could you explain step by step (mouse click by mouse click) what you do to produce the text file with Writer.

My procedure:
1/ open a new empty text document with Writer
2/ import the csv file : menu Insert > Text from file
3/ insert the string ID;Model;Tube;Position;Dates;Times;Ions;Selection;Series;Settings
at top of the data
4/ add the string ;1-1629-0001-1;1-1617-0003-8;1.1; in front of each line
5/ save as TXT file
6/ close Writer
7/ open with Gedit

Status has been set to NEEDINFO, please set it back to UNCONFIRMED once requested information has been provided.

Best regards. JBF
Comment 8 Paul Mirowsky 2020-05-06 22:09:43 UTC
It appears that a \r is being introduced somehow. I believe \r is a CR (carriage return) character.
When opening a document that was processed in Writer and saved as .txt it generates \r. This is confirmed by using Ubuntu Text Editor and using "find and replace" with \r. Then all lines become proper single line, not split.
Comment 9 Buovjaga 2020-08-28 14:14:16 UTC
Created attachment 164804 [details]
CSV with CR chars removed

(In reply to Paul Mirowsky from comment #8)
> It appears that a \r is being introduced somehow. I believe \r is a CR
> (carriage return) character.
> When opening a document that was processed in Writer and saved as .txt it
> generates \r. This is confirmed by using Ubuntu Text Editor and using "find
> and replace" with \r. Then all lines become proper single line, not split.

If I open the file in Notepad++ on Win and turn on "Show all characters", I see it uses CR and LF line endings.

Attached is the file with CR chars removed. Does it make any difference for you?
Comment 10 Dieter 2021-08-30 19:30:37 UTC
Paul, a new major release of LibreOffice is available since this bug was reported. Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?

If the bug is still valid, please also answer question from Buovjaga in comment 9. Thank you.

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 11 Justin L 2021-09-25 06:35:16 UTC
Created attachment 175251 [details]
textChooseEncoding.png: File - Save As - "Text - Choose encoding"

Writer allows you to specify if you want to save a CR, LF, or CR&LF along with Unicode BOM when saving as a text file. That should give you what you want.
Comment 12 QA Administrators 2022-03-25 03:39:23 UTC Comment hidden (obsolete)
Comment 13 QA Administrators 2022-04-25 03:27:15 UTC
Dear Paul Mirowsky,

Please read this message in its entirety before proceeding.

Your bug report is being closed as INSUFFICIENTDATA due to inactivity and
a lack of information which is needed in order to accurately
reproduce and confirm the problem. We encourage you to retest
your bug against the latest release. If the issue is still
present in the latest stable release, we need the following
information (please ignore any that you've already provided):

a) Provide details of your system including your operating
   system and the latest version of LibreOffice that you have
   confirmed the bug to be present

b) Provide easy to reproduce steps – the simpler the better

c) Provide any test case(s) which will help us confirm the problem

d) Provide screenshots of the problem if you think it might help

e) Read all comments and provide any requested information

Once all of this is done, please set the bug back to UNCONFIRMED
and we will attempt to reproduce the issue. Please do not:

a) respond via email 

b) update the version field in the bug or any of the other details
   on the top section of our bug tracker

Warm Regards,
QA Team

MassPing-NeedInfo-FollowUp