[Solved] Text within a cell: Remove <br> to end

Discuss the spreadsheet application
Post Reply
mrcastle
Posts: 10
Joined: Thu May 07, 2015 6:09 pm

[Solved] Text within a cell: Remove <br> to end

Post by mrcastle »

Hi everyone... hoping you can help with a major head-scratcher (at least for me) I have a bunch of html text that I need to delete within a cell. In the sample I've attached, I want to remove all of the text after the first <br> (as well as that <br>) That should limit the size to each line to a very simple & short description, which is perfect.

I have about 2500 listings and doing this manually will take forever! Thank you for any input.
Last edited by Hagar Delest on Mon May 10, 2021 7:34 am, edited 1 time in total.
Reason: tagged solved.
OpenOffice 4.1.0 on Windows 7
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Reducing text within a cell

Post by FJCC »

First, make a copy of your file in case something goes wrong. Using the Edit -> Find & Replace dialog:
1. Enter
<br>.*$
in the Search For box.
2 Leave the Replace With box empty.
3. Click More Options and select Regular Expressions.
4. Click Replace All
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.
mrcastle
Posts: 10
Joined: Thu May 07, 2015 6:09 pm

Re: Text within a cell: Remove <br> to end

Post by mrcastle »

Wow fantastic! Is there an additional figure you can use to reverse that formula ? (anything to the left of the <br> ) Hope you don't mind my asking, as you've definitely resolved the biggest part. Thanks again so much.
OpenOffice 4.1.0 on Windows 7
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: [Solved] Text within a cell: Remove <br> to end

Post by Hagar Delest »

I guess so but you need to provide more details (no attachment in your first post, limit the file size to 128KB maximum).
You can also see the help files about regular expressions (help button in the F&R dialog).
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
MrProgrammer
Moderator
Posts: 4895
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: [Solved] Text within a cell: Remove <br> to end

Post by MrProgrammer »

mrcastle wrote:[Remove] anything to the left of the <br>
Regular Expression matching <br> and all text to its left:   ^.*<br>
Regular expression matching <br> and all text to its right: <br>.*$
mrcastle wrote:Hope you don't mind my asking, as you've definitely resolved the biggest part.
You're really supposed to open a new topic for a new question after the original question has been solved.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.

[Tutorial] Ten concepts that every Calc user should know
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Post Reply