[Solved] Line Break in Calc Concatenate

Discuss the spreadsheet application
Post Reply
dgsarnow
Posts: 35
Joined: Fri May 02, 2008 6:20 pm

[Solved] Line Break in Calc Concatenate

Post by dgsarnow »

I am working on OpenOffice 3.0 in a windows vista environment. I have been using oo for about 3 years.

I am looking to concatenate several cells together, but I would like to include a line break so that the data from each cell is on a new line in the cell.

Cell1,Cell2,Cell3
This,is,Cool

Desired output:
This
Is
Cool

I cannot find the syntax for this.

Anyone know how I can do this?

Dave
Last edited by dgsarnow on Thu Oct 16, 2008 6:58 pm, edited 1 time in total.
OpenOffice 3.1 | Ubuntu 9.04
User avatar
squenson
Volunteer
Posts: 1885
Joined: Wed Jan 30, 2008 9:21 pm
Location: Lausanne, Switzerland

Re: Line Break in Calc Concatenate

Post by squenson »

This is not possible with a formula. The concatenation of strings does not preserve the line breaks, and even the simple formula A2: = A1 does not properly reflect the content of A1 in cell A2 in case A1 contains a line break.
LibreOffice 4.2.3.3. on Ubuntu 14.04
Trave11er
Posts: 2
Joined: Sat Oct 25, 2008 5:15 pm

Re: [Solved] Line Break in Calc Concatenate

Post by Trave11er »

Yeah, just tried to do ="Line One" & CHAR(10) & "Line Two"

Calc will always give you:
Line One Line Two

instead of:
Line One
Line Two

Too bad. Anyone know a fix?

Edit: Heh... was just playing around with it. If you Copy -> Paste Special -> Text , it does give you the carriage return .
OOo 3.0.X on Mac OSx Leopard
exegete77
Volunteer
Posts: 230
Joined: Tue May 06, 2008 3:45 pm

Re: [Solved] Line Break in Calc Concatenate

Post by exegete77 »

The CODE for the line break is 32. However, using CHAR(32) does not reproduce the desired result.
Mac OS X 10.7.3 Lion
LibreOffice 3.5 / Symphony 3
Scrivener 2.2 / Tinderbox 5.10
Trave11er
Posts: 2
Joined: Sat Oct 25, 2008 5:15 pm

Re: [Solved] Line Break in Calc Concatenate

Post by Trave11er »

Yeah, looks like it reads it as CHAR(32) which is the ASCII space.
bear454
Posts: 1
Joined: Wed Nov 28, 2007 6:34 pm

Re: [Solved] Line Break in Calc Concatenate

Post by bear454 »

=CONCATENATE("Line1",CHAR(10),CHAR(13),"Line2")
=>
Line1
Line2
User avatar
squenson
Volunteer
Posts: 1885
Joined: Wed Jan 30, 2008 9:21 pm
Location: Lausanne, Switzerland

Re: [Solved] Line Break in Calc Concatenate

Post by squenson »

bear454,

Which version of OOo do you use? With OOo 3.1.0, it gives Line1Line2, and I even had to replace the delimiter "," by ";" to make the formula work...
LibreOffice 4.2.3.3. on Ubuntu 14.04
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: [Solved] Line Break in Calc Concatenate

Post by acknak »

This is coming soon: in OOo 3.2, due in November. The code is already in the current snapshots, although it's not working exactly right for me (on Linux). See Issue 35913: reference to content with explicit newlines in cells.

If you're interested in this feature, I suggest testing one of the developer snapshots for OOo 3.2 (the "DEV300" code line), available here: http://download.openoffice.org/next/

As always, don't use a snapshot build to edit important files.
AOO4/LO5 • Linux • Fedora 23
Post Reply