[Solved] How to delete all line feed and carriage-return

Discuss the word processor
Post Reply
User avatar
fazillatheef
Posts: 14
Joined: Tue Feb 09, 2010 3:46 pm

[Solved] How to delete all line feed and carriage-return

Post by fazillatheef »

The following was the method that I used ,but it didn't work
1. Open the document and press Ctrl+F , The find and replace dialog will pop up.
2. Click on more options and check Regular expression.
3. Searched for [\r\n].

I had enabled "Display non printable character". I expected the carriage return and linefeeds to be selected.

But nothing was selected. Please Help!!!
Thanks in Advance
Last edited by fazillatheef on Wed Feb 24, 2010 11:08 am, edited 1 time in total.
Open Office org 3.0.1 in Windows Vista
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to delete all line feed and carriage-return

Post by RoryOF »

Download and install AltSearch
http://extensions.services.openoffice.org/en/node/3315
and make life easy for yourself.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
fazillatheef
Posts: 14
Joined: Tue Feb 09, 2010 3:46 pm

Re: How to delete all line feed and carriage-return

Post by fazillatheef »

RoryOF wrote:Download and install AltSearch
http://extensions.services.openoffice.org/en/node/3315
and make life easy for yourself.
It doesn't work in Open Office 3.0.1
I downloaded and checked it on my computer. I also read a comment saying that it won't work on Open office 3.0.1
Open Office org 3.0.1 in Windows Vista
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to delete all line feed and carriage-return

Post by RoryOF »

Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
vasa1
Volunteer
Posts: 261
Joined: Sat Dec 26, 2009 1:20 pm
Location: Bombay

Re: How to delete all line feed and carriage-return

Post by vasa1 »

RoryOF wrote:Look at http://homepage.ntlworld.com/garryknigh ... egexp.html for some hints.
Nice! Thanks! :D

More comprehensible than the built-in Help.
LibreOffice 5.2.1.2 on Lubuntu 16.04 (Openbox)
User avatar
fazillatheef
Posts: 14
Joined: Tue Feb 09, 2010 3:46 pm

Re: How to delete all line feed and carriage-return

Post by fazillatheef »

RoryOF wrote:Look at http://homepage.ntlworld.com/garryknigh ... egexp.html for some hints.
I tried many combinations like
\n
\n\n
\r\n
\n\r
\r\r
\r

Nothing worked. Can this be a bug in Open office.
Open Office org 3.0.1 in Windows Vista
User avatar
Hagar Delest
Moderator
Posts: 32668
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: How to delete all line feed and carriage-return

Post by Hagar Delest »

fazillatheef wrote:It doesn't work in Open Office 3.0.1
I downloaded and checked it on my computer. I also read a comment saying that it won't work on Open office 3.0.1
Can't you upgrade to 3.2?
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
fazillatheef
Posts: 14
Joined: Tue Feb 09, 2010 3:46 pm

Re: How to delete all line feed and carriage-return

Post by fazillatheef »

Hagar de l'Est wrote:
fazillatheef wrote:It doesn't work in Open Office 3.0.1
I downloaded and checked it on my computer. I also read a comment saying that it won't work on Open office 3.0.1
Can't you upgrade to 3.2?
My company has more than 1.5 lakh employees. So I work in an office enviroment where we are restricted from updating or installing softwares. The update for Openoffice need to be added into our SOE(Standard Operating environment- stupid name to restrict us from updating software). Even though I have given quite a few requests to the team responsible ,they haven't initiated it. :-(

The transition from Microsoft Office to Open office wasn't smooth. All the templates are using macros written in VBA which are incompatible with Open office. There are many other problems too. Since the program update don't happen properly these problems never get solved. And everyone's blaming Open Office for that. :-(

Thanks for your interest
Open Office org 3.0.1 in Windows Vista
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to delete all line feed and carriage-return

Post by RoryOF »

\n has just worked for me using standard Find and Replace. When I enable Display non printing characters, Shift Enter gives a backward pointing arrow. I was able to tell F&R to look for \n and replace with %%. Your combination \n\r tells it to find the newline character, followed by a "literal r", as OpenOffice does not interpret the \r as a carriage return. I think you may have to wait until someone more familiar with regular expressions comes online - I use the Alt Search when I have complicated searching, so don't know regular expressions well.
 Edit: A large macro to remove excess line breaks from documents is given and discussed at
http://www.oooforum.org/forum/viewtopic ... ight=ascii. It may be overkill for your needs. 
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
fazillatheef
Posts: 14
Joined: Tue Feb 09, 2010 3:46 pm

Re: How to delete all line feed and carriage-return

Post by fazillatheef »

RoryOF wrote:\n has just worked for me using standard Find and Replace. When I enable Display non printing characters, Shift Enter gives a backward pointing arrow. I was able to tell F&R to look for \n and replace with %%. Your combination \n\r tells it to find the newline character, followed by a "literal r", as OpenOffice does not interpret the \r as a carriage return. I think you may have to wait until someone more familiar with regular expressions comes online - I use the Alt Search when I have complicated searching, so don't know regular expressions well.
 Edit: A large macro to remove excess line breaks from documents is given and discussed at
http://www.oooforum.org/forum/viewtopic ... ight=ascii. It may be overkill for your needs. 
It worked.

Thank you. I have saved lot of time :D
Open office wins again!!!
Open Office org 3.0.1 in Windows Vista
Post Reply