I want to remove carriage returns (hard new lines) in txt

I need to delete CR’s in text. In Word this is easy.How can I do this in Libroffice?

How to Remove Line Breaks and Carriage Returns in Microsoft Word
2. With the insertion point in the Find what box, click Special and then click Paragraph Mark or click Manual Line Break
If you don’t see the Special button, click More
3. In the Find What field, if you selected Paragraph Mark, type: ^p
If you selected Manual Line Break, type: ^l

In the Replace With box, don’t type anything, leave it blank
Note: If there is no space between first and last words of old lines once your remove breaks, type a space into the replace with box

  1. Now click Find Next

  2. Keep repeating until all the extra lines are gone.

Do you want to end up in .txt format (as inferred from your question title)? If so, save as .txt and reopen with a text editor. In a text editor, it is very easy to remove the line breaks.

Understanding the discussion of ICU and its imperfect implementation in LibreOffice I recommend the usage of AltSearch.oxt, which is not perfect but often can help in such cases…

Same question at: Ik wil 'Line feed' (CR) vervangen, in Word gaat dat met ^p, hoe gaat dat in Libroffice?.

@Citroentje, See @anon73440385 comment for the answer.

HI,

  1. Open the Find and Replace Dialaog (menu Edit > Find and Replace... ) or (shortcut CTRL+H)
  2. In the Find text enter \r
  3. Leave the Replace text empty
  4. In Other options (might be closed, expand it): check Regular expression
  5. Press Replace Button for Step by Step Replacement

Hope it helps.

Where did you get \r from (ICU?)? This does neither find a paragraph end ($) nor a line break entered through SHIFT+ENTER, which is \n in Find-context (see List of Regular Expressions).

1 Like

It seemed to be defined

ref. Regular Expressions - Old location of the ICU User Guide

But i have to admit, i did not test it. Sorry, maybe i was wrong.

yes - ICU, but it is not/not fully supported in LibreOffice, though (confusingly) somewhere it is stated that ICU library is being used in LibreOffice.

You mean this

(src: List of Regular Expressions)

right?

If it does not work (as described), is it a “missing” feature, or a bug in the documentation?
Or something else?