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

Discuss the spreadsheet application

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

Postby mrcastle » Sun May 09, 2021 4:21 am

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
mrcastle
 
Posts: 8
Joined: Thu May 07, 2015 6:09 pm

Re: Reducing text within a cell

Postby FJCC » Sun May 09, 2021 5:05 am

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
Windows 10 and Linux Mint, since 2017
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 8121
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

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

Postby mrcastle » Mon May 10, 2021 6:07 am

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
mrcastle
 
Posts: 8
Joined: Thu May 07, 2015 6:09 pm

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

Postby Hagar Delest » Mon May 10, 2021 7:36 am

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.0.5 on Xubuntu 21.04 and 7.0.5 portable on Windows 10
User avatar
Hagar Delest
Moderator
 
Posts: 29752
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

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

Postby MrProgrammer » Mon May 10, 2021 3:36 pm

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 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 4006
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA


Return to Calc

Who is online

Users browsing this forum: No registered users and 32 guests