[Solved] Find and replace -- with an "em" dash

Discuss the word processor
Post Reply
LuAnn4220
Posts: 25
Joined: Thu Apr 08, 2010 10:50 pm

[Solved] Find and replace -- with an "em" dash

Post by LuAnn4220 »

I know that there is a setting that will change two hyphens with an "em" dash as you type. But I have a document that is being created with a third-party dialog box. Text for headings is entered into the dialog box, and no special characters are allowed. This text is then applied on the page and hundreds of individual documents are then joined into one long document.

So the final product with have MANY incidences of two hyphens that need to be replaced by the "em" dash.

Is there a code that can be used for the find/replace? (Similar to the find/replace ^$ with nothing that I use to remove empty paragraphs)
Last edited by Hagar Delest on Fri Mar 23, 2012 11:27 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.0 Windows XP
User avatar
RoryOF
Moderator
Posts: 35223
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Find and replace -- with an "em" dash: what is the "code

Post by RoryOF »

Open /Insert /Special Character and find the em dash. Paste one anywhere in your file. Now close Special Characters. Select the em dash and Ctrl X. Now open /Edit /Find and Replace, enter -- in Find box and move to he Replace box, Now Ctrl V to Paste the em dash. Tell it to Replace all and your job is done. This roundabout way of inserting the em dash is because last time I tried (and every time before) /Insert /Special Characters _would not_ insert direct to the Replace box. You might be able to enter the em dash directly into Replace by a Unicode code; I have no experience of this.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Find and replace -- with an "em" dash: what is the "code

Post by acknak »

I can get the special characters dialog from the Find & Replace dialog with Ctrl+Shift+s.

Does that not work for you?
AOO4/LO5 • Linux • Fedora 23
User avatar
MrProgrammer
Moderator
Posts: 5436
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Find and replace -- with an "em" dash: what is the "code

Post by MrProgrammer »

According to Wikipedia:How to make dashes typing an Em Dash is trivial for Macs and Linux using facilities of the operating system. For example for Mac, one simply types ⇑⌥- (Shift+Option+Hyphen) in the Find/Replace dialog box (or anywhere else — like that one I just entered in this web page).

Unfortunately for those poor souls stuck with Windoze, the procedures are complicated or arcane or both. In the Wikipedia article, the details are in the Long Explanation, which is over 2000 words. The simplest way seems to be using Alt+0151 or Alt++2014, as explained there, but you may find a method that you like better.
 Edit: I did not see the Ctrl+Shift+S advice until after posting. The corresponding Mac shortcut is ⌘⇑S, also shown in the context menu when right-clicking the Replace With field in the dialog. But, neither ⌘⇑S nor selecting Insert Special Character from the context menu works on my system. (No Insert Special Character dialog appears; instead nothing happens.) This problem isn't reported in Bugzilla, that I can find. I acknowledge that I'm running an older release of OOo and would want to test with the current release before reporting it. Ctrl+Shift+S seems like a good method for Windoze. I don't need it because I can insert special characters with Mac OS X facilities. 
Last edited by MrProgrammer on Fri Mar 23, 2012 8:34 pm, edited 1 time in total.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
RoryOF
Moderator
Posts: 35223
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Find and replace -- with an "em" dash: what is the "code

Post by RoryOF »

acknak wrote:I can get the special characters dialog from the Find & Replace dialog with Ctrl+Shift+s.

Does that not work for you?
I never tried that, acknak. Just tried it - it works! Thanks.
Apache OpenOffice 4.1.16 on Xubuntu 24.04.4 LTS
LuAnn4220
Posts: 25
Joined: Thu Apr 08, 2010 10:50 pm

Re: Find and replace -- with an "em" dash: what is the "code

Post by LuAnn4220 »

acknak wrote:I can get the special characters dialog from the Find & Replace dialog with Ctrl+Shift+s.

Does that not work for you?
MOST EXCELLENT!

Many thanks for the help.
OpenOffice 3.0 Windows XP
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Find and replace -- with an "em" dash: what is the "code

Post by acknak »

MrProgrammer wrote:... Ctrl+Shift+S seems like a good method for Windoze. I don't need it because I can insert special characters with Mac OS X facilities.
Right; I agree. For common characters, like em-dash, I normally use keyboard shortcuts to enter them by code.

Where I don't know the code, I much prefer to use the system's character map: it's much easier/nicer to use than OOo's, and I can insert characters either by copy/paste, or by drag/drop, right into the Find & Replace dialog.

I can never remember the goofy shortcut for OOo's special character dialog--I had to look it up in the help ;-)
AOO4/LO5 • Linux • Fedora 23
Post Reply