Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove line break within cell google spreadsheet

Is there an easy way to remove the line breaks within each cell?Spreadsheet Image

Each cell on column E, has extra line that I am having to manually remove, any easy to remove all.

like image 530
Agent_Sully Avatar asked Aug 23 '17 23:08

Agent_Sully


Video Answer


2 Answers

Easiest method:

  1. Bring up the Find and Replace box (Ctrl+h on Windows)
  2. Tick the box Search with regular expressions
  3. In the Find input field, type \n
  4. Leave the Replace with field empty
  5. Click Replace all
  6. (If there are still spaces left, click Replace all again)

enter image description here

like image 106
florian Avatar answered Oct 03 '22 22:10

florian


How about following sample? This sample supposes that the line break is \r\n and \n.

FLow :

  1. Retrieve the information of line break.
  2. If the line break is \r\n, when the number of \r\n is more than 2, it is modified to char(10).

Sample :

=IF(REGEXMATCH(E1, "\r\n"),REGEXREPLACE(E1, "(\r\n){2,}", char(10)),REGEXREPLACE(E1, "(\n){2,}", char(10)))

Result :

enter image description here

If you want to remove all of the line break, you can use =CLEAN(A1). In this case, the result of the result sheet becomes sample1sample2sample3sample4sample5.

If this was not helpful for you, I'm sorry.

like image 27
Tanaike Avatar answered Oct 03 '22 20:10

Tanaike