I have a worksheet of text in Numbers where some cells have a blank line between the text. How do I run a routine across the whole worksheet to remove all the blank lines as I can’t seem to make ‘Find/Replace’ achieve this. Thank you.
I am trying to make the worksheet easier to read as some of the cells are very long.
So at first when I read your question I thought you meant you imported some data and now have blank ROWS between the rows of actual data.
But rereading it, I think you mean that you have cells of data that have lots of text in them, with multiple lines of text. And some of these lines are blank. And you simply want to remove those blank lines within the cells of text. Is that right?
Find & Replace is the way to do it. Here's how:
Use Command+F to bring up the Find panel.
Click on the settings menu on the left to switch from Find to Find & Replace.
In the first field, use Option+Return to search for a new line character. Put two in there so it looks like this: \n\n
In the second filed, put a single Option+Return so it looks like: \n
Now the Find & Replace will fail to find anything. You'll see the Replace All button still inactive. It seems that using just new line characters doesn't trigger the panel to do the preliminary search.
So go back to the first text field and add a space after the \n\n. This will give you "Not Found" on the right (unless you happen to have some blank lines that are followed by another line that starts with a space.
Now delete that space after the \n\n and it will search again and give you X found on the right. The Replace All button will be active. Now you can click it to remove all of the blank lines.
I followed your words and it all worked exactly as you set out, until I reached the last paragraph which said: "Now delete that space after the \n\n and it will search again and give you X found on the right." Sadly, it remained as "Not Found" and the Replace All button wasn't active. Sorry about that. I can email you the file if you'd like to have a play with it. Thanks for your help with this - it's much appreciated.
Brian: Keep trying things. Try adding an x and deleting it. Try restarting Numbers. Instead of pasting the Option+Return twice, try selecting the blank space at the end of a line of text, and the next line too and pasting that instead.
I had the exact same thing happen when I tried it as well. However, when I went back to the \n\n and deleted the second \n so only the first \n was there, it worked. So, try the above advice again, but then delete the last \n and see if that works for you like it did for me.
@Circleof05th - thanks, it worked for me too with one \n in the first field and not in the second. Thanks Gary too. Great work as always.