Ask Your Question
2

How to add line break to search and replace [closed]

asked 2013-08-26 11:02:07 +0200

In many documents I have the following:

| | *

What I require is

| | 
    *

i.e. I need to find | | * and replace this with | | and then a line break and then *

How do I do this? Any help greatly appreciated :)

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2015-11-07 10:59:48.146084

2 Answers

Sort by » oldest newest most voted
3

answered 2013-08-26 11:54:32 +0200

David gravatar image

updated 2013-08-26 12:13:01 +0200

If I understand correctly (and asterisk is a literal * rather than a wildcard), then you need to:

  1. Do CTRL-H to bring up the Find & Replace dialog
  2. Click on "More Options" (bottom left button)
  3. Make sure "Regular expressions" is checked/selected
  4. Then in your "Search for" box, enter: \| \| \* and in the "Replace with" enter: | | \n*

That should do it. (Although in your example, you have some spaces in front of the asterisk?) You might want to un-check "Regular expressions" next time you do search-replace.

For more help on Regular Expressions, have a look at the LibreOffice help, or this useful OpenOffice "how-to".

edit flag offensive delete link more

Comments

1

Thanks David, Works just as required :)

Gary gravatar imageGary ( 2013-08-27 02:27:19 +0200 )edit

Great help.. Thanks a lot ;-)

sreehari.sathyanandan gravatar imagesreehari.sathyanandan ( 2015-02-15 05:59:59 +0200 )edit
2

answered 2013-08-26 17:31:12 +0200

Edward gravatar image

David's Find and Replace steps do work, but I've found the Alternative Dialog Find & Replace extension to be easier to use (and has more options): http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer

edit flag offensive delete link more

Comments

@Edward - great extension, and I use it quite a bit. Not sure how it helps in this particular case, though, and it can be tricky to use. Could you help out OP by suggesting how you would use this extension to accomplish his search/replace? Thanks!

David gravatar imageDavid ( 2013-08-26 18:08:29 +0200 )edit

Great help.. Thanks a lot ;-)

sreehari.sathyanandan gravatar imagesreehari.sathyanandan ( 2015-02-15 05:59:04 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2013-08-26 11:02:07 +0200

Seen: 40,350 times

Last updated: Aug 26 '13