[Solved] How to enter ASCII codes in Find / Replace dialog?

Discuss the word processor

[Solved] How to enter ASCII codes in Find / Replace dialog?

Postby Cardinal2B » Wed Aug 14, 2019 9:14 pm

I'm hunting ellipses (3 dots that are one character) and replacing them with 3 periods. I have to do this a lot thanks to AutoCorrect. I've turned that off, but have lots of them I have to find in existing documents.
Of course, you can't spot them just by opening the document and looking.
So, I'd like to open a document, open a Find/Replace dialog, type in the ascii code 133 somehow, and type in 3 periods in the Replace with box, and Replace All.
I know I could copy an ellipsis from the document and paste it into the Find box, but I reaqlly want to type in the ascii code.
How do I do that?
I've tried carats, and U and \u and Ctl+Alt all to no avail...
what am I missing? what are the exact keystrokes I need?
Thanks!
Last edited by RoryOF on Fri Aug 16, 2019 6:16 pm, edited 2 times in total.
Reason: Added green tick [RoryOF, Moderator]
Open Office 4.1.5 on Windows Surface
Cardinal2B
 
Posts: 5
Joined: Wed Aug 14, 2019 9:02 pm

Re: how to enter ascii codes in Find / Replace dialog?

Postby RoryOF » Wed Aug 14, 2019 9:29 pm

As far as I know, you can't. Copy and Paste is the way.

 Edit: One could use AltSearch from the extensions repository, which can be driven from a batch file; however, AltSearch syntax takes some mastering, so it might be quicker to make a file with the ellipsis and the replacement three dots, copy from that into Find and Replace into your target files, and use Replace all button. 
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29893
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: how to enter ascii codes in Find / Replace dialog?

Postby Lupp » Wed Aug 14, 2019 10:51 pm

Thats not an ASCII code. The unicode place is U+2026.
You can search for this character with regular expressions in F&R entering \u2026 in any place of the SearchString. Same way it works with any unicode character whose CodePlace has 4 hex digits.
The ReplaceString does not accept this coding.
(It works with V4.1.5 of AOO - and in LibO for a long time now. I don't remember for which version of AOO it was implemented first. I would suppose it was an update of the ICU RegEx engine which brought it. But even in LibO the otherwise there usable Alt+X command for CodePointNumberHex<-->Character replacement does not work in F&R)
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: 2564
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: how to enter ascii codes in Find / Replace dialog?

Postby RoryOF » Wed Aug 14, 2019 11:00 pm

Thank you for that, Lupp. Note that on my OO, Regular Expressions needs to be checked (on More Options dropdown). It does not work in the Replace box - the string is treated as a literal.
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29893
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: How to enter ASCII codes in Find / Replace dialog?

Postby Cardinal2B » Fri Aug 16, 2019 4:06 pm

Lupp thanks very much! Obviously I am operating above my knowledge level here with regard to these codes!
BUT with the Regular Expressions box checked as RoryOF noted, I was able to type
\u2026
in the Search for box, then specify what to Replace with, click Replace All and voila!~
Excellent! Thank you very much! :bravo:
Open Office 4.1.5 on Windows Surface
Cardinal2B
 
Posts: 5
Joined: Wed Aug 14, 2019 9:02 pm

Re: How to enter ASCII codes in Find / Replace dialog?

Postby RoryOF » Fri Aug 16, 2019 4:09 pm

Note that the unicode will not work in the Replace box; if you need a unicode character as the Replace, you will have to Copy and Paste it there (Ctrl C, Ctrl V)
Apache OpenOffice 4.1.7 on Xubuntu 18.04.3 (mostly 64 bit version) and very infrequently on Win2K/XP
User avatar
RoryOF
Moderator
 
Posts: 29893
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland


Return to Writer

Who is online

Users browsing this forum: No registered users and 22 guests