Delete repetitive spaces
Delete repetitive spaces
Well, this must be a real Newbie question. I have a text with sometimes two or more white spaces where only one should be. I cannot get any of the three ways of doing search and replace in NWP (1.4.2) to replace them. I was used to Word (Win) where you just type in spaces in the find box and then the number of spaces you want to replace them with in the replace box, and it works. For whatever reason, that doesn't work (for me at least) in NWP.
Re: Delete repetitive spaces
Hi, NisusUser
Open Find/Replace. Select PowerFind Pro from the Using: pop-up. In the Find What field type the following:
(Note: hit the spacebar twice and then type a plus sign.)
In the Replace With field type:
(Hit the spacebar once.)
Any trouble let me know.
Cheers, Henry.
Open Find/Replace. Select PowerFind Pro from the Using: pop-up. In the Find What field type the following:
Code: Select all
+In the Replace With field type:
Code: Select all
Any trouble let me know.
Cheers, Henry.
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Delete repetitive spaces
This should work in NWP just fine, eg: if you type two spaces into the "find what" field, one space into the "replace with" field, and click "Replace All", that will collapse all two space sequences in your document to a single space.NisusUser wrote:I was used to Word (Win) where you just type in spaces in the find box and then the number of spaces you want to replace them with in the replace box, and it works. For whatever reason, that doesn't work (for me at least) in NWP.
Perhaps you have some exotic spaces in your document (eg: a thin space)? If so, you could use a PowerFind expression like this: You can insert those bubbles using the little "gear icon" button next to the "find what" field. From that button, use the menus Wild Card > Any Space and Repeat > 1+. Once you have the (AnySpace)(1+) expression, just type a single space into the "replace with" field, and then click "Replace All" to zap all spaces in your document.
If you still have trouble, let us know.
Re: Delete repetitive spaces
Thank you both, Henry and Martin. I'll try both ways. I think, Martin, that I did what you said except that I didn't know about the 1+ gizmo. I can't look at it today, but maybe tomorrow. Thanks again!
Re: Delete repetitive spaces
Alternatively, you can use this macro. It affects a selected text, if any. If there is no selection, the whole document is fixed.
Henry.
Henry.
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Delete repetitive spaces
Thanks for the macro Henry.
The "1+" bubble is just the PowerFind way of saying "match one or more of the thing that comes just before". In this case, match one or more of the "Any Space" bubble. But you don't need need to get fancy with PowerFind if you don't want to. You could just type in two regular spaces and replace them with a single space.
Sure thing.NisusUser wrote:I think, Martin, that I did what you said except that I didn't know about the 1+ gizmo. I can't look at it today, but maybe tomorrow. Thanks again!
The "1+" bubble is just the PowerFind way of saying "match one or more of the thing that comes just before". In this case, match one or more of the "Any Space" bubble. But you don't need need to get fancy with PowerFind if you don't want to. You could just type in two regular spaces and replace them with a single space.