[Solved] Remove any instances of "(integer)" from a cell

Discuss the spreadsheet application
Post Reply
cul
Posts: 62
Joined: Mon Jan 29, 2018 1:15 pm

[Solved] Remove any instances of "(integer)" from a cell

Post by cul »

Hi, is it possible to use a formula to remove all instances of an integer within 2 brackets (and the brackets themselves)?

such that
Todd Terje
Cortex (6)
Hanna (24) / Almir Ricardi
A.A.L. (Against All Logic)
Leon Vynehall

appears as
Todd Terje
Cortex
Hanna / Almir Ricardi
A.A.L. (Against All Logic)
Leon Vynehall

Thanks for any help!
Last edited by robleyd on Sun Apr 19, 2020 8:43 am, edited 2 times in total.
Reason: Add green tick
LibreOffice on Windows 7 (sometimes Mac)
FJCC
Moderator
Posts: 9582
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Remove any instances of "(integer)" from a cell

Post by FJCC »

You can do this with Find & Replace. Highlight all of the cells you want to affect then select the menu item Edit -> Find & Replace. In the Search For box enter

Code: Select all

\(\d+\)
Leave the Replace With box empty. Click on More Options and select Regular Expressions and Current Selection Only. Click Replace All and you should be done.
Make sure you save a copy of the document in case something goes wrong.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
cul
Posts: 62
Joined: Mon Jan 29, 2018 1:15 pm

Re: Remove any instances of "(integer)" from a cell

Post by cul »

Great, that worked. I would prefer to add a formula to a cell - so that I don't have to refer back to this post every week - but this absolutely gets the job done. Thank you.
LibreOffice on Windows 7 (sometimes Mac)
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Remove any instances of "(integer)" from a cell

Post by RusselB »

You can use the regex (the code provided by FJCC) as the search parameter in the SUBSTITUTE function.
See the help file for more information about this function.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
cul
Posts: 62
Joined: Mon Jan 29, 2018 1:15 pm

Re: Remove any instances of "(integer)" from a cell

Post by cul »

Perfect, thank you.
LibreOffice on Windows 7 (sometimes Mac)
Post Reply