Eliminating Unwanted Periods

Discuss the word processor

Eliminating Unwanted Periods

Postby jimsey » Wed Dec 18, 2019 6:16 pm

I often have word processing files where there are too many spaces between words or sets of numbers. In previous editions of Open Office I simply searched for two or more spaces and replace them with one space. Now I find that searching on two spaces identifies any two spaces in the text. How can I search for extra spaces and replace them with something else? For example, I want to change:
xx     xx
to
xx xx

 Edit: Discussion continued at Get rid of too many periods, like .......; topic locked to prevent fragmentation of discussion 
Last edited by MrProgrammer on Sat Dec 28, 2019 8:12 pm, edited 2 times in total.
Reason: Added [pre][/pre] tags; Edited title, was: Eliminating Unwanted Spaces
Open Office 4.0.0 installed on Windows 8
jimsey
 
Posts: 6
Joined: Sun Dec 22, 2013 7:03 pm

Re: Eliminating Unwanted Spaces

Postby Lupp » Wed Dec 18, 2019 6:46 pm

jimsey wrote:Now I find that searching on two spaces identifies any two spaces in the text.

That's what I would expect if I use F&R. Would you please explain?
On Windows 10: LibreOffice 6.2 and older versions, PortableOpenOffice 4.1.5 and older, StarOffice 5.2
---
Lupp from München
User avatar
Lupp
Volunteer
 
Posts: 2669
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Eliminating Unwanted Spaces

Postby RoryOF » Wed Dec 18, 2019 6:55 pm

Also what I expect. If you only wish to find double spaces in a particular area, select that, and in /Find and Replace drop More Options and select "Current Selection only".
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Eliminating Unwanted Spaces

Postby MrProgrammer » Wed Dec 18, 2019 7:36 pm

jimsey wrote:How can I search for extra spaces and replace them with something else?
Something else?? I will guess that the goal is to replace multiple contiguous spaces with one.

Edit → Find & Replace → More options → ✓ Regular Expressions → Search for → ␢+ → Replace with → → Replace All

In the previous paragraph the symbol represents a space character. I recommend unchecking Regular expressions before clicking Close. You can select the Current selection only option if you need. If you require any additional assistance attach a document demonstrating the situation (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). Explain what you have tried, what happened, and what you expected/wanted to happen instead.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3953
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Eliminating Unwanted Spaces

Postby RoryOF » Wed Dec 18, 2019 7:46 pm

When I need to do this, I search for two spaces, replace with one, and run that same F&R operation until it reports no double spaces found. Often easier than messing with regular expressions, which, if one gets them wrong can wreak havoc!
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Eliminating Unwanted Spaces

Postby jimsey » Wed Dec 25, 2019 6:26 pm

Thanks for the replies. I was mixed up, and I apologize for my mistake. What I really meant was periods, not spaces. Accordingly, I posted another request as follows: I am running Open Office 4.1.7 on Windows 10. I often have word processing files where there are too many periods [i.e., the mark . ] between words or sets of numbers. In previous editions of Open Office I simply searched for two or more periods and replaced them with something else, perhaps one period. Now I find that searching on two periods identifies any two spaces in the text. How can I search for extra periods and replace them with something else? For example, I might want to change "xx......xx" to "xx.xx". [Just to be clear, by the word “periods” I am talking about the diacritical mark used to end a sentence.]
Open Office 4.0.0 installed on Windows 8
jimsey
 
Posts: 6
Joined: Sun Dec 22, 2013 7:03 pm

Re: Eliminating Unwanted Spaces

Postby RoryOF » Wed Dec 25, 2019 6:52 pm

In Find and Replace you may need to drop "More Options" and uncheck "Regular expressions"
Apache OpenOffice 4.1.7 on Xubuntu 18.04.4 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 30430
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Eliminating Unwanted Spaces

Postby John_Ha » Wed Dec 25, 2019 7:55 pm

See [Tutorial] How to record a macro (and Regular Expressions) and read the bit about Regular Expressions. If you are using Regular Expressions - which means if you have ticked the Regular Expressions under More - searching with a full stop finds a space.

Showing that a problem has been solved helps others searching so, if your problem is now solved, please view your first post in this thread and click the Edit button (top right in the post) and add [Solved] in front of the subject.
LO 6.3.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
John_Ha
Volunteer
 
Posts: 7269
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK


Return to Writer

Who is online

Users browsing this forum: No registered users and 9 guests