Ask Your Question
1

Some "Find and Replace" questions [closed]

asked 2013-12-18 10:20:40 +0200

SK gravatar image

Hi, I have a few basic technical questions about using "Find and Replace" in LibreOffice:

  1. Is it possible to delete all text in a document that use a specific character format (like font size and/or bold)? How do you do it?

  2. When doing Find and Replace, how to you search for characters that follow or are followed by a carriage return?

  3. When doing Find and Replace, how do you insert a carriage return before or after certain characters?

If anyone knows, thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-16 17:33:41.410438

1 Answer

Sort by » oldest newest most voted
2

answered 2013-12-18 11:53:25 +0200

David gravatar image

updated 2013-12-18 13:17:04 +0200

1. Character format?

There are two ways. First, using the CTRL-H dialog to get the "Find and Replace" window, then choose "Format", and select the attributes you want from the next window. You might need to toggle-on the "Other Options" drop-down to get these buttons:

CTRL-H

Your other option is to use the "Properties" option in the very useful LibreOffice extension, Alternative Find & Replace (you'll need to install it, of course):

Alt Find/Replace

If you search AskLibO for "alternative find & replace", you'll find quite a few Q&As dealing with it. Very useful!

2. Characters following return?

You need to use the "Regular expressions" option with CTRL-H; you might need to toggle the "Other Options" drop-down to see it (see the first pic, above).

My (still) favourite resource for this is the OpenOffice wiki on Regex which is still applicable to LibO Writer. (But see also the LibO regex help, and the LibO Find & Replace help.)

For characters that follow a return (i.e., first characters of next paragraph), search like this (assuming you're looking for "cat"):

^cat

That ^ signals "match at beginning". To get "cat" followed by a return, search for:

cat$

and $ signals "match at the end". (So searching for ^$ should find you all "empty" paragraphs.)

3. Insert return?

Using the "Regular expressions" option, search for cat, and then for "Replace with", use cat\n, and the \n will add the "new line" or ¶ for you. (Don't forget to uncheck "Regular expressions" when you're done, or you may be mystified next time you search for something, forgetting that you're using regex! Been there, done that.)

Also, do look at other LibO find-and-replace Q&As for plenty more of value. Hope this helps for a start!

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2013-12-18 10:20:40 +0200

Seen: 721 times

Last updated: Dec 18 '13