Page 1 of 1

[Solved] Finding and replacing newline characters

Posted: Tue Dec 21, 2010 8:58 pm
by ptoye
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.

Re: Finding and replacing newline characters

Posted: Tue Dec 21, 2010 9:21 pm
by Robert Tucker
Probably easiest to do with AltSearch.

Re: Finding and replacing newline characters

Posted: Wed Dec 22, 2010 11:44 am
by ptoye
Not heard of that one. Thanks. I'll try it. It doesn't come with a README - is installation and operation intuitive?

Re: Finding and replacing newline characters

Posted: Wed Dec 22, 2010 11:52 am
by RoryOF
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/ ... 29&start=0 

Re: Finding and replacing newline characters

Posted: Wed Dec 22, 2010 2:15 pm
by ptoye
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.

Re: Finding and replacing newline characters

Posted: Wed Dec 22, 2010 2:17 pm
by ptoye
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?

Re: Finding and replacing newline characters

Posted: Wed Dec 22, 2010 2:29 pm
by RoryOF
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.

Re: Finding and replacing newline characters

Posted: Tue Dec 28, 2010 12:26 pm
by ptoye
Managed to install it OK now and all working fine. Thanks for the pointer.

Snow all gone now.