Hi.
OpenOffice Calc converts Carriage Return to Line Feed when opening a csv-file.
Is there a way to change this behaviour?
[Issue] Carriage Return converted to Line Feed when opening CSV file
[Issue] Carriage Return converted to Line Feed when opening CSV file
Last edited by MrProgrammer on Thu Jun 01, 2023 8:11 pm, edited 2 times in total.
OpenOffice 4.1.14 on win10
- Hagar Delest
- Moderator
- Posts: 32662
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: openoffice calc converts Carriage Return to Line Feed when opening a csv file
Hi and welcome to the forum!
Can you upload a sample file showing that (see How to attach a document here)?
I don't see that with LibreOffice and I'm not sure CSV makes the difference between carriage return and line feed. Thus, can't see how AOO/LO could make the difference.
Can you upload a sample file showing that (see How to attach a document here)?
I don't see that with LibreOffice and I'm not sure CSV makes the difference between carriage return and line feed. Thus, can't see how AOO/LO could make the difference.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Re: Carriage Return converted to Line Feed when opening a csv file
I have attached the original file and two screenshots:
Original file: File after opening and saving:
Original file: File after opening and saving:
- Attachments
-
- test.csv
- (37 Bytes) Downloaded 44 times
OpenOffice 4.1.14 on win10
- MrProgrammer
- Moderator
- Posts: 4906
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Carriage Return converted to Line Feed when opening a csv file
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
Re: Carriage Return converted to Line Feed when opening a csv file
Specify the text delimiter as " (double-quote) and you get the ID and three lines of text in cell B2.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
- MrProgrammer
- Moderator
- Posts: 4906
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Carriage Return converted to Line Feed when opening a csv file
Yes, however the Carriage Return characters U+000D in the CSV file were imported as Linefeed characters U+000A in B2, as shown in the image below. This is what the OpenOffice issue describes.
Data in CSV files is often in strange configurations, depending on what conventions the creator used. In this case we have a CRLF sequence written as three(!) characters: CarriageReturn Backslash n. It's hardly surprising that Calc cannot support every weird convention that might exist. Since the Linefeed was created as \n it's odd that Carriage Return isn't \r. \r\n would import/export properly, though it wouldn't display as multi-line in a cell. If the goal is to have multi-line cell value, Calc has done the import properly since only Linefeed does that. =1&CHAR(10)&2 displays as two lines; =1&CHAR(13)&2 as one.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
- Hagar Delest
- Moderator
- Posts: 32662
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: [Issue] Carriage Return converted to Line Feed when opening CSV file
At least the import follows the intent of the writer it seems. Since for the ID 1, the string was designed to be on 3 lines.
Thus in this case, it is not really a bug. It is just an operation to be done on that kind of content.
Thus in this case, it is not really a bug. It is just an operation to be done on that kind of content.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10