I have a spreadsheet containing values that are entered as text by having an apostrophe '
in front. I tried the search and replace function, but for some reason it couldn't find those cells containing an apostrophe in front. I tried changing the cell format to number, but it didn't cause those text to become numbers.
Because there are many cells like that, it would take a long time to individually delete the starting apostrophe in each cell. Is there a faster way to do this?
Answer
I found out these things
Use LibreOffice version 3.6.5 instead of 4.0.
The newest LibreOffice 4.0 (see changelog) changed its RegEx engine toICU regexp engine
. As a result I wasn't able to use the LibreOffice 3.6.5 solution for LibreOffice 4.0(Maybe this has changed since this answer was given in 2013. So try out the newest available version first)
Disable
Tools » AutoCorrect Options » Localized options » Single quotes
.
This option replaces your single quote with a similar looking apostrophe. Unfortunately this doesn't change your existing cellsThe screenshot demonstrates the visual difference with and without this option enabled
To replace cells with leading single quote:
'
(U+0027):Press CTRL+H » Click
More options
» CheckRegular expressions
.
Search for^.*$
and replace with&
It searches for everything inside a cell and replace the cell content with the existing cell content - but without the leading single quote since you disabled the AutoCorrect option. Have a look at the reference if you want to read more about Regular Expressions
To replace cells with leading apostrophes:
‘
(U+2018) or’
(U+2019) orʼ
(U+02BC):
Which character is used depends on where you live and what local settings are usedPress CTRL+H » Click
More options
» CheckRegular expressions
.
Search for^[‘’ʼ]
and replace with nothing.
Alternative
Copy & Paste the whole spreadsheet content to Notepad or Notepad++, do the Search & Replace and copy the content back.
Comments
Post a Comment