[Solved] Finding and replacing newline characters

Discuss the word processor

[Solved] Finding and replacing newline characters

Postby ptoye » Tue Dec 21, 2010 8:58 pm

I have an imported text file, and want to delete the newline whenever the line ends with an equals sign. Is there any way to do this using find/replace? Or any other way, for that matter? Apart from writing a Java program to do it. The sort of thing that awk and ed can do in a few lines.
Last edited by Hagar Delest on Wed Dec 29, 2010 12:46 am, edited 1 time in total.
Reason: tagged [Solved].
Peter
OO 4.0.1 on Ms Windows 7
ptoye
 
Posts: 148
Joined: Mon Apr 21, 2008 11:07 am
Location: Reading, England

Re: Finding and replacing newline characters

Postby Robert Tucker » Tue Dec 21, 2010 9:21 pm

Probably easiest to do with AltSearch.
OpenOffice 4.0.0 and LibreOffice 4.x.x on Fedora 20, Ubuntu 13.10, Windows 8.1 Preview (Triple Boot)
User avatar
Robert Tucker
Volunteer
 
Posts: 1230
Joined: Mon Oct 08, 2007 1:34 am
Location: Manchester UK

Re: Finding and replacing newline characters

Postby ptoye » Wed Dec 22, 2010 11:44 am

Not heard of that one. Thanks. I'll try it. It doesn't come with a README - is installation and operation intuitive?
Peter
OO 4.0.1 on Ms Windows 7
ptoye
 
Posts: 148
Joined: Mon Apr 21, 2008 11:07 am
Location: Reading, England

Re: Finding and replacing newline characters

Postby RoryOF » Wed Dec 22, 2010 11:52 am

Reasonably so. Be advised that OOo has restrictions on paragraph length arising from programming decisions made years ago; it doesn't like paras longer than 64K characters, which is reasonable enough in terms of reading comprehension, but which situation can effectively arise in circumstances of removing paragraph marks/line feeds. Best in those circumstances to maintain a master copy of your file in case of disaster.

How is the snow in Reading?

 Edit: You may find it of use to look at
http://user.services.openoffice.org/en/forum/viewtopic.php?f=7&t=27929&start=0 
Apache OpenOffice 4.0.1 on Xubuntu 13.10 and Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 14346
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Finding and replacing newline characters

Postby ptoye » Wed Dec 22, 2010 2:15 pm

Rory, thanks.

As the lines whose line end character need deleting are (without exception) followed by lines where it isn't deleted, the 64k restriction isn't an issue, but thanks for the warning.

I've installed the addon by double-clicking on the .oxt file but when I click on its icon nothing at all happens. I've a nasty feeling it's a permissions issue, but don't really know where to go from here.
Peter
OO 4.0.1 on Ms Windows 7
ptoye
 
Posts: 148
Joined: Mon Apr 21, 2008 11:07 am
Location: Reading, England

Re: Finding and replacing newline characters

Postby ptoye » Wed Dec 22, 2010 2:17 pm

RoryOF wrote:How is the snow in Reading?



Not bad, it's just above zero at the moment, so it's slowly melting. And we never had more than about 10 cm. Other places had it a lot worse. How's yours?
Peter
OO 4.0.1 on Ms Windows 7
ptoye
 
Posts: 148
Joined: Mon Apr 21, 2008 11:07 am
Location: Reading, England

Re: Finding and replacing newline characters

Postby RoryOF » Wed Dec 22, 2010 2:29 pm

In OpenOffice / Tools / Extension Manager does Alternative Searching show up as an installed Extension? If not, click on the Add button on bottom of that window and point it to the AltSearch.oxt file you have downloaded. I then had to restart Openoffice before there was an entry under
/ Edit / Alt Find and Replace which opens the Alt Find and Replace dialog.

12" of snow last night on 6" lying (left after 24" during last three weeks). Well stocked with food. Main road running slowly, but running. Car blocked in by 100yds drive covered by 12" snow. Plenty of food and oil. OK so long as electricity/phone don't fail.
Apache OpenOffice 4.0.1 on Xubuntu 13.10 and Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 14346
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Finding and replacing newline characters

Postby ptoye » Tue Dec 28, 2010 12:26 pm

Managed to install it OK now and all working fine. Thanks for the pointer.

Snow all gone now.
Peter
OO 4.0.1 on Ms Windows 7
ptoye
 
Posts: 148
Joined: Mon Apr 21, 2008 11:07 am
Location: Reading, England


Return to Writer

Who is online

Users browsing this forum: No registered users and 16 guests