Saturday, May 4, 2024
 Popular · Latest · Hot · Upcoming
7
rated 0 times [  7] [ 0]  / answers: 1 / hits: 25080  / 2 Years ago, tue, may 31, 2022, 8:43:18

In Libre office calc I have a bunch of cells that contain empty lines. A single cell looks like this:



breaks



How can I delete the empty lines from the cells to get cells that look like this:



no breaks



I do not want to edit 200 cells by hand to delete the blank lines. I'm sure there is a faster way.



P.S. I obtained these cells by copying a table from a website into Libre office calc. For that I used the clip-board.


More From » libreoffice

 Answers
3

I assume you want to remove multiple empty lines in one step if possible. To remove a single line, there's a context menu entry.



There are two possible approaches to remove multiple lines without much hassle:




  • as proposed in this answer: sort the lines alphabetically so the empty lines get sorted to the start or end, then delete them.


  • as proposed in this blog post: use filtering to get only the blank lines displayed, then select and delete them, then remove the filter.




EDIT:



To remove hard line breaks inside cells automatically, you could use the search / replace functionality and regular expressions. Just search for
and let the replace box empty. Don't forget to activate "Regular expressions" under More Options.... You won't see a result immediately, since Calc doesn't change the row height automatically. So you will have to set the row height using Optimal row height... in the context menu after removing the line breaks.



search - replace



EDIT 2:



It may be possible that there aren't any empty lines in the cells, so the search/replace operation may fail. This is because LibreOffice automatically applies styles from the original html tables when pasting data from the web. To make sure that it isn't just a row format issue, just select the complete sheet and select Optimal height... from Menu Format -> Row.


[#37855] Wednesday, June 1, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rieency

Total Points: 299
Total Questions: 116
Total Answers: 111

Location: Wales
Member since Tue, Dec 14, 2021
2 Years ago
rieency questions
Wed, Aug 25, 21, 15:17, 3 Years ago
Wed, Jun 23, 21, 04:37, 3 Years ago
Fri, Sep 30, 22, 12:07, 2 Years ago
Thu, Feb 24, 22, 00:50, 2 Years ago
Mon, Mar 28, 22, 13:28, 2 Years ago
;