Ask Your Question
2

A macro for removing data?

asked 2012-04-24 04:57:00 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

updated 2012-04-24 04:57:00 +0200

anonymous user

Anonymous

Dear IT gurus,

I need to remove some data from some spreadsheets. I would like to know if there is an easy way to do it.

What I need to do is this:

I have these types of entries:

< abc > < xyz >

My question is this: Is there a simple way to extract all such entries without having to do it for each entry,i.e., is there a way I can remove all the < > brackets and data between them in one go?

If you know how to do this I would be grateful if you would let me know what I need to do.

Best wishes,

Techno Peasant

delete close flag offensive retag edit

Comments

Techno Peasant -- Still looking for help here?

qubit ( 2013-03-13 05:11:51 +0200 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2012-04-24 05:29:16 +0200

doubi gravatar image doubi
11 1

You don't need a macro to do this - regular expressions should be able to sort you out.

  • Press Ctrl-H to bring up the full Find and Replace dialogue box.

  • Click the More Options button if you see it at the bottom right.

  • Check the 'Regular expressions' checkbox

  • Now, in the 'Search for' combo-box at the top, enter:

    <.*>

  • Leave the 'Replace with' combo-box blank.

Now when you click 'Replace', this should go through your spreadsheet finding any instance of a left angle-bracket (<) followed by any number of any characters (.*) followed by a right angle-bracket (>) and replace it with nothing, i.e., remove it.

link delete flag offensive edit

Comments

@doubi, If LO uses greedy-matching, wouldn't that mean that your REGEXP would change something like "<a>foo</a> stuff to keep <b>bar</b>" to the empty string "" instead of the intended " stuff to keep "?

(If LO uses non-greedy matching, then we'd get "foo stuff to keep bar")

qubit ( 2013-01-27 07:37:59 +0200 )edit

Login/Signup to Answer

Donate

LibreOffice is made available by volunteers around the globe, backed by a charitable Foundation. Please support our efforts: Your donation helps us to deliver a better product!

Question tools

Follow

subscribe to rss feed

Stats

Asked: 2012-04-24 04:57:00 +0200

Seen: 105 times

Last updated: Apr 24 '12