[Solved] Remove a paragraph mark between 2 paragraphs
[Solved] Remove a paragraph mark between 2 paragraphs
I don't find my answer in the previous thread nor in the http://www.oooninja.com regex or the writer regex guide, so thank you not redirecting me.
Question:
I past a document in simple text of a few paragraphs in Writer
In writer each paragraph ends with a paragraph mark (inversed P) + an empty paragraph (inversed P) + the next paragraph, etc.
para1para1 (inversed P)
(inversed P)
para2para2 (inversed P)
(inversed P)
para3para3 (Inversed P)
I apply header style and paragraph style to the text, and of course, I want to remove the paragraph mark between the 2 paragraph text.
If I search for "$" and replace with "(emtpy)"
- I get a unique paragraph - all the paragraph marks are removed.
If I search for "^$" and replace with "(emtpy)"
- it returns nothing - it only works in the case of there is double (inversed P) between 2 paragraph text.
I also tried search for "$$" and replace with "(empty)"
- it returns nothing - and I don't figure out when I can use it?
How do I remove all these empty lines (inversed P marks) between 2 paragraphs of text. Thank you.
Question:
I past a document in simple text of a few paragraphs in Writer
In writer each paragraph ends with a paragraph mark (inversed P) + an empty paragraph (inversed P) + the next paragraph, etc.
para1para1 (inversed P)
(inversed P)
para2para2 (inversed P)
(inversed P)
para3para3 (Inversed P)
I apply header style and paragraph style to the text, and of course, I want to remove the paragraph mark between the 2 paragraph text.
If I search for "$" and replace with "(emtpy)"
- I get a unique paragraph - all the paragraph marks are removed.
If I search for "^$" and replace with "(emtpy)"
- it returns nothing - it only works in the case of there is double (inversed P) between 2 paragraph text.
I also tried search for "$$" and replace with "(empty)"
- it returns nothing - and I don't figure out when I can use it?
How do I remove all these empty lines (inversed P marks) between 2 paragraphs of text. Thank you.
Last edited by Hagar Delest on Sun Sep 04, 2011 11:58 pm, edited 2 times in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
Re: How to remove a pragarph mark between 2 paragaphs of tex
Is there a workaround because it looks like a bug to me.
^$ is definitely what I am looking for. I can search for "^$" and replace with "nothing" when I type a document in Writer. The empty paragraph lines are removed. It works as intended.
The command is ineffective with any simple text document I paste from a text editor (leafpad, bluefish, etc.) to Writer. Text paragraphs and paragraph marks display correctly in the writer document, but searching for "^$" is ineffective.
Could someone on Linux with OOo 3.3 (Oracle) try and get back to me. I hope I am wrong.
^$ is definitely what I am looking for. I can search for "^$" and replace with "nothing" when I type a document in Writer. The empty paragraph lines are removed. It works as intended.
The command is ineffective with any simple text document I paste from a text editor (leafpad, bluefish, etc.) to Writer. Text paragraphs and paragraph marks display correctly in the writer document, but searching for "^$" is ineffective.
Could someone on Linux with OOo 3.3 (Oracle) try and get back to me. I hope I am wrong.
Re: Remove a pragarph mark between 2 paragaphs of text (Bug?
In Find box: ^$
In Replace box: nothing
Drop More Options and Select Regular Expressions (won't work without this)
Then press Replace All
Check that there is nothing for Attributes or Format until you get it working.
The reversed P is called a "Pilcrow", and derives from a mark used by mediaeval scribes to mark paragraph ends.
In Replace box: nothing
Drop More Options and Select Regular Expressions (won't work without this)
Then press Replace All
Check that there is nothing for Attributes or Format until you get it working.
The reversed P is called a "Pilcrow", and derives from a mark used by mediaeval scribes to mark paragraph ends.
Edit: If you are having difficulty we would like to see a short file; the Attach button is below the Send button on the Post a Reply window. |
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Remove a pragarph mark between 2 paragaphs of text (Bug?
Pilcrow, I will keep that in mind, thanks.RoryOF wrote:The reversed P is called a "Pilcrow", and derives from a mark used by mediaeval scribes to mark paragraph ends.
It makes sens. So far, on my system with a (default) configuration, it look like a bug. The feature works as expected when I type some paragraphs of text directly in Writer. I does not work for any paragraphs of text I paste from a simple text application to writer.
Edit: If you are having difficulty we would like to see a short file; the Attach button is below the Send button on the Post a Reply window.
See next post for file samples (max attachments 3)
Re: Remove a pragarph mark between 2 paragaphs of text (Bug?
sample files.
1. simple text sample created in Leafpad (simple text editor)
2. writer document in which I have pasted the content of the simple text sample
Can you try on your end?
[Deleted]
[Deleted]
1. simple text sample created in Leafpad (simple text editor)
2. writer document in which I have pasted the content of the simple text sample
Can you try on your end?
[Deleted]
[Deleted]
Last edited by nomnex on Sat Sep 08, 2012 9:56 am, edited 1 time in total.
Re: Remove a pragarph mark between 2 paragaphs of text (Bug?
Hi,
Your sample_simple_text file in the .gz archive contains 0A 0A (hex) for line breaks but not 0D 0A (hex). (I viewed it with a hexa editor)
The 0A 0A means the line break singn in OOo (Shift-ENTER)
and the 0D 0A means the Paragraph break in OOo (Enter)
Your sample_simple_text file in the .gz archive contains 0A 0A (hex) for line breaks but not 0D 0A (hex). (I viewed it with a hexa editor)
The 0A 0A means the line break singn in OOo (Shift-ENTER)
and the 0D 0A means the Paragraph break in OOo (Enter)
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
Re: Remove a pragarph mark between 2 paragaphs of text (Bug?
In haste - no time to try your sample files. Tibor's diagnosis of some of the end of characters as being Line feeds (0A chars) suggests that you should search for \n to find them (Regular expressions must be checked). If you want to turn them into regular paragraph marks (Pilcrows), use \n in the Replace box (\n has different meaning in each box). If you just want to delete them, use nothing in the Replace box.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Remove a pragarph mark between 2 paragaphs of text (Bug?
Both of the attached files work as expected for me.
With the text file,
If not sure it's helpful to think of the text breaks in Writer as corresponding to certain characters, as is the case for text files.
With the text file,
- File > New > Text Document
Insert > File > Name: sample_simple_text.txt (i.e., the unzipped text)
Edit > Find & replace
Search for: ^$
Replace with: empty
If not sure it's helpful to think of the text breaks in Writer as corresponding to certain characters, as is the case for text files.
AOO4/LO5 • Linux • Fedora 23
Re: Remove a paragraph mark between 2 paragraphs of text (Bu
Thanks to everyone for your time and feedback
Zizi64 & RoryOF,
I don't know about hexa number and editor, and it confirms my impression, Writer does not interpret correctly copied & pasted simple text paragraphs (i.e. para break for line break) and it displays pilcrows (vs. line break marks). And F&R on empty paragraph lines is broken.
I gave another try opening a blank writer doc and copying the same text file. F & R using "\n" (Regex selected) returns the same error as in my first print-screen (see: print-screen below) You might want to give it a try when you have some free time.
acknak,
Insert > File (convert the simple text file 'to Writer formatting'). Thanks to point that out.
But ain't that a bug? I would expect a WYSIWYG word processor to past portion of text from other documents correctly. Insert > File is a all or nothing operation.
What do you think?
Zizi64 & RoryOF,
I don't know about hexa number and editor, and it confirms my impression, Writer does not interpret correctly copied & pasted simple text paragraphs (i.e. para break for line break) and it displays pilcrows (vs. line break marks). And F&R on empty paragraph lines is broken.
I gave another try opening a blank writer doc and copying the same text file. F & R using "\n" (Regex selected) returns the same error as in my first print-screen (see: print-screen below) You might want to give it a try when you have some free time.
acknak,
Insert > File (convert the simple text file 'to Writer formatting'). Thanks to point that out.
But ain't that a bug? I would expect a WYSIWYG word processor to past portion of text from other documents correctly. Insert > File is a all or nothing operation.
What do you think?
Re: Remove a paragraph mark between 2 paragraphs of text (Bu
The \n matches line breaks, not paragraph breaks.
There are no line breaks in the .odt document attached and searching for \n finds no matches. Likewise, the text file doesn't produce them when you import it.
Cut and paste can lead to unusual results, depending on exactly what software is involved.
There are no line breaks in the .odt document attached and searching for \n finds no matches. Likewise, the text file doesn't produce them when you import it.
Cut and paste can lead to unusual results, depending on exactly what software is involved.
AOO4/LO5 • Linux • Fedora 23
Re: Remove a paragraph mark between 2 paragraphs of text (Bu
I read Zizi64 comment too fast.
He says the paragraph marks in the text file are line breaks in the simple text document (an not in Writer - as I read first) How could that be? A simple text editor don't produce line breaks to my knowledge. Either copying from a wiki desktop: Zim, an email client: sylpheed, or my text editor - all are simple text applications - and pasting in Writer give the same problem. I can't remove the empty lines.
Note: I don't have this problem when I past HTML formatted text, the <p> tags are dully interpreted in writer, and there is no empty line.
So no easy way to copy and past simple text documents in writer (except "File > Import"), and to search for and remove empty lines between the paragraphs?
Out of curiosity is it the same in the LO version, if anyone has a version at hand.
He says the paragraph marks in the text file are line breaks in the simple text document (an not in Writer - as I read first) How could that be? A simple text editor don't produce line breaks to my knowledge. Either copying from a wiki desktop: Zim, an email client: sylpheed, or my text editor - all are simple text applications - and pasting in Writer give the same problem. I can't remove the empty lines.
Note: I don't have this problem when I past HTML formatted text, the <p> tags are dully interpreted in writer, and there is no empty line.
So no easy way to copy and past simple text documents in writer (except "File > Import"), and to search for and remove empty lines between the paragraphs?
Out of curiosity is it the same in the LO version, if anyone has a version at hand.
Re: Remove a paragraph mark between 2 paragraphs of text (Bu
I have tried sample_simple_text_copied_to_odf.odt, using OOo 3.3 on Ubuntu 10.10, replacing the line end options with % to show its location
Find $ replaces four Paragraph marks
Find ^$ replaces four Paragraph marks
One can see that it is finding the correct line end in each case. I'm not worried about the last one - special handling for one end of file indicator is not unusual or a great burden.
Find $ replaces four Paragraph marks
Code: Select all
line 1 %¶
line 2 %¶
line 3 %¶
line 4 %¶
line 5¶
Code: Select all
line 1 ¶
%line 2 ¶
%line 3 ¶
%line 4 ¶
%line 5¶
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
Re: Remove a paragraph mark between 2 paragraphs of text (Bu
It looks like I was wrong about end of line in simple text editor http://en.wikipedia.org/wiki/Newline
RoryOF last comment:
I can reproduce it and that's a step forward. Any of my previous "copy/past & search/replace" were done in a new Writer document.
To sum up:
1a. Open a simple text editor
1b. Type some text lines separated by an empty line
1c. Copy the content in the clipboard
2a. Open a new Writer document
2b. Past the content of the clipboard in the Writer document
2c. Find and Replace "^$" (Regex)
It fails (msg. Search key not found)
3a. Save the document
3b. Find and Replace "^$" (Regex)
It fails again (msg. Search key not found)
4a. Close and re-open the document
4b. Find and Replace "^$" (Regex)
Works as expected.
As awkward as it is, a writer document as to be saved, closed & re-opened to remove the empty lines.
RoryOF last comment:
I can reproduce it and that's a step forward. Any of my previous "copy/past & search/replace" were done in a new Writer document.
To sum up:
1a. Open a simple text editor
1b. Type some text lines separated by an empty line
1c. Copy the content in the clipboard
2a. Open a new Writer document
2b. Past the content of the clipboard in the Writer document
2c. Find and Replace "^$" (Regex)
It fails (msg. Search key not found)
3a. Save the document
3b. Find and Replace "^$" (Regex)
It fails again (msg. Search key not found)
4a. Close and re-open the document
4b. Find and Replace "^$" (Regex)
Works as expected.
As awkward as it is, a writer document as to be saved, closed & re-opened to remove the empty lines.
Re: [Solved] Remove a paragraph mark between 2 paragraphs
I usually wait ~2 weeks before to mark a question [Solved], in the event people want to add comments/bring new relevant information. I am not positive, but as far as I can remember, I didn't change the subject as solved. Has someone done it on my behave?
- Hagar Delest
- Moderator
- Posts: 32661
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: [Solved] Remove a paragraph mark between 2 paragraphs
It's me as mentioned in the bottom of your first post.
It seems that you've found a solution, that's why I've tagged it solved. Usually, very few users care to do it. If you disagree, edit your post, remove the tag and the green tick-mark.
It seems that you've found a solution, that's why I've tagged it solved. Usually, very few users care to do it. If you disagree, edit your post, remove the tag and the green tick-mark.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
Re: [Solved] Remove a paragraph mark between 2 paragraphs
No problem here. It used to be a time you, or the other mood, wrote "please change the title as solved if...". I usually revisit my questions, but if you update the posts status on your own, be welcome to do so. I did not occur me to look at the bottom of the first post. I will do next time.Hagar Delest wrote:It's me as mentioned in the bottom of your first post.
- Hagar Delest
- Moderator
- Posts: 32661
- Joined: Sun Oct 07, 2007 9:07 pm
- Location: France
Re: [Solved] Remove a paragraph mark between 2 paragraphs
Not all mods do that. I add this when I engage in a thread and when there is a proposal that should fix the problem (there are some case where you can't so no need to put it).nomnex wrote:It used to be a time you, or the other mood, wrote "please change the title as solved if...".
I know. Visibility of the edit is not that good. Very few notice it.nomnex wrote:I did not occur me to look at the bottom of the first post. I will do next time.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10