Using search or find function for line breaks

Discuss the spreadsheet application
Post Reply
andy713
Posts: 2
Joined: Tue Nov 17, 2009 7:59 pm

Using search or find function for line breaks

Post by andy713 »

How can I use either the search or find function in a formula to locate the position of a line break in another cell? In Excel this is char(10). I've tried this and other characters and I enabled regex and tried \n so far. I hope this is possible.

Thanks,

Andy Johnson
OpenOffice 3.1 on Windows XP and Slackware64 13
mriosv
Volunteer
Posts: 651
Joined: Mon Mar 09, 2009 1:12 am
Location: Galiza (España)

Re: Using search or find function for line breaks

Post by mriosv »

Using
=SEARCH(CHAR(10);F22;1)
works well to find line break (Ctrl-Enter).
OOo 3.1.1
LibreOffice 3.5.4 AOo-3.4 on Win 7 Ultimate
andy713
Posts: 2
Joined: Tue Nov 17, 2009 7:59 pm

Re: Using search or find function for line breaks

Post by andy713 »

I'm sorry, but that just doesn't work. If it was that easy it would have worked when Calc opened the Excel spreadsheet. It returns #VALUE! Just to be sure it wasn't because it was sourced from Excel, I tried it in a new empty Calc worksheet, and it's the same error: abc (cntl-enter) ef gh (cntl-enter) ijk in cell A1, =search(char(10);a1;1) in b1 displays #VALUE!. This happens in both Linux and Windows versions. As an additional test, copy the string in a1 down through multiple cells, and enter the formula =CODE(MID(A1;ROW();1)) in b1 and copy it down too. The code for (cntl-enter) is 32, the same as a space. Since this is obviously wrong, there must be some other trick. Or it is something that Calc is just not capable of doing.

Andy
OpenOffice 3.1 on Windows XP and Slackware64 13
Post Reply