Ask Your Question
1

How do I insert line breaks in Writer with find & replace? [closed]

asked 2014-01-27 18:29:58 +0200

Deranged gravatar image

I've installed the extension mentioned elsewhere.... but I fail to see any instructions on how to make it actually find XXX and replace it with a line break. I've tried \n... that just enters a backslash and an 'n'.

Thanks

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 2016-02-19 04:07:01.374174

2 Answers

Sort by » oldest newest most voted
2

answered 2014-01-27 20:39:05 +0200

Edward gravatar image

Assuming the extension is "Alternative Find & Replace", you'll need to check off "Regular expressions" if you manually enter \n or \p in the replace field. If you use the extension's built in replace drop down box it will (besides showing you the many options) automatically check off "Regular expressions" for you.

edit flag offensive delete link more
1

answered 2014-01-28 02:04:53 +0200

David gravatar image

You can do this with CTRL-H search/replace without using the (excellent) AltSearch add-on. Exactly how depends on your OS (as you'll see), and you haven't mentioned your platform (Win? Mac? Linux flavour?). What you need to know is the method for input of ASCII values for your system. I'm on Linux Mint 13 (at the moment), and will use the key strokes that work for me.

So - to replace XXX with line-break (not paragraph break, which is easier!):

  1. CTRL-H to bring up search/replace dialog; ensure that Other Options drop down is showing, and
    [✓] Regular expressions ticked.
  2. put your XXX sequence in the "Search for" box. If XXX is a whole word, you can ensure you only get it by entering the search this way: \<XXX\> (the slash-brackets ensure that your sequence starts and ends the whole word you're searching on).
  3. to REPLACE this with soft-return (shows up as when you do CTRL-F10 to reveal non-printing characters), TYPE this sequence into the "Replace with" box: CTRL SHIFT U then 000A (three zero's followed by cap "A", NO SPACES). This (on my system) inputs ASCII Chr(10), the "line-feed" code. [This is the bit you'll need to adapt to your own operating system.]
  4. Click "Replace all". Should put in your soft-returns throughout.

Variation: If you want to put that soft-return after XXX, then put an ampersand (&) in the "Replace with" box, immediately followed by the CTL-SH-U+000A code, as above.

Note: see also an earlier Q&A on some "find and replace" questions.

edit flag offensive delete link more

Comments

1

This IS the real answer! It is a pitty that LO doesn't have an easy way to support this. Another regex in the list would help.

Genom gravatar imageGenom ( 2017-09-05 13:44:34 +0200 )edit

Question Tools

1 follower

Stats

Asked: 2014-01-27 18:29:58 +0200

Seen: 6,798 times

Last updated: Jan 28 '14