I would like to append to a found "Search for" text with a different font style without replacing the original text. I know that you can use the Regular expressions (aka.wildcard) to append to found text by using "&" and you can change the "Replace with" format to change the output text, but would like to append to the original text with a different font to distinguish between the two.
e.g.
Find: roses (in Arial)
Replace: & are red (in Times New Roman format)
desired output: roses (in Arial) are red (in Times New Roman)
actual output: rose are red (all in Times New Roman)
[Solved] Find and append in a different font
-
- Posts: 2
- Joined: Sat Jul 15, 2017 11:09 pm
[Solved] Find and append in a different font
Last edited by MrProgrammer on Sat Nov 21, 2020 2:44 am, edited 1 time in total.
Reason: Tagged ✓ [Solved]
Reason: Tagged ✓ [Solved]
Open Office 4.1.3 Windows10
Re: Find and Append-not Replace
A quick look at the options available implies to me that you can specify the Font in the Search by selecting the Format button while the cursor is in the Search part of the Find and Replace Dialog.
The same button is available when the cursor is in the Replace portion of the dialog.
The format button is in the More Options section, which you seem to be aware of, as that is where the switch to allow Regular Expressions in the search is located.
The same button is available when the cursor is in the Replace portion of the dialog.
The format button is in the More Options section, which you seem to be aware of, as that is where the switch to allow Regular Expressions in the search is located.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Re: Find and Append-not Replace
You can find the character that follows the word "bode" with this in the Search For box
In the Replace With you can then insert text, say the word HERE, between bode and the found character with
The HERE can be formatted and will not affect the format of the "bode". This will affect the formatting of the character following bode. If that is a space, then I expect you can tolerate that. Otherwise. you can make a second search for the text following whatever you inserted and reformat it.
Code: Select all
(?<=bode).
Code: Select all
HERE&
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Re: Find and Append-not Replace
I'm not sure I understand what you're trying to do, but as far as I know it's not possible for the replacement text to be formatted in any particular way.
If you've worked out the find & replace to get the text you want, "Replace All" should leave you with all of the replacements selected. At that point, you can "Find All" for the appended replacement text string, with the "Current selection only" option ON, and get only the appended text selected. Then you can apply whatever formatting you want as a separate action (nothing to do with Find & Replace).
Oops. For some reason, when I tried this at first, "Replace All" did leave all of the replacements selected; trying it again, I see that it doesn't. I'm not sure why that's behaving differently now.
In that case, you may have to make the appended text unique in some way, for example, replace with &{abc}, the do a separate search for the bracketed text, apply the formatting, then find/replace to remove the brackets.
OIC. If you do "Replace All" with the Format specified (say, with a specific font), then "Find All" leaves the replacements selected. Without the format option, it doesn't.
If you've worked out the find & replace to get the text you want, "Replace All" should leave you with all of the replacements selected. At that point, you can "Find All" for the appended replacement text string, with the "Current selection only" option ON, and get only the appended text selected. Then you can apply whatever formatting you want as a separate action (nothing to do with Find & Replace).
Edit: PS: |
In that case, you may have to make the appended text unique in some way, for example, replace with &{abc}, the do a separate search for the bracketed text, apply the formatting, then find/replace to remove the brackets.
Edit: PPS: |
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 2
- Joined: Sat Jul 15, 2017 11:09 pm
[SOLVED] Re: Find and Append-not Replace
Thanks for the suggestions however none worked for me.
It seams that you can add text by:
Search for: \<(original text) [in original Format]
Replace with: additional text& [with new Format]
Always replaces: original text additional text [all in new Format]
If somebody tests and figures out a way to add text in a new format without changing the original text's format, please let me know
It seams that you can add text by:
Search for: \<(original text) [in original Format]
Replace with: additional text& [with new Format]
Always replaces: original text additional text [all in new Format]
If somebody tests and figures out a way to add text in a new format without changing the original text's format, please let me know
FJCC wrote:You can find the character that follows the word "bode" with this in the Search For boxIn the Replace With you can then insert text, say the word HERE, between bode and the found character withCode: Select all
(?<=bode).
The HERE can be formatted and will not affect the format of the "bode". This will affect the formatting of the character following bode. If that is a space, then I expect you can tolerate that. Otherwise. you can make a second search for the text following whatever you inserted and reformat it.Code: Select all
HERE&
Last edited by ksuperjack on Sun Jan 24, 2021 4:23 pm, edited 1 time in total.
- MrProgrammer
- Moderator
- Posts: 4907
- Joined: Fri Jun 04, 2010 7:57 pm
- Location: Wisconsin, USA
Re: Find and Append-not Replace
Hi, and welcome to the forum.
File → New → Text document → type the two letters DT then press F3. (This creates a test paragraph.)
Edit → Find & Replace
Search for: steps → Replace with: & Ω → More options → Regular expressions → Replace All
Search for: Ω → Replace with: *** → Format → Size=16 → OK → Replace All
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.
Let Ω represent a character or characters which will not otherwise appear in your text.ksuperjack wrote:Find: roses (in Arial)
Replace: & are red (in Times New Roman format)
desired output: roses (in Arial) are red (in Times New Roman)
File → New → Text document → type the two letters DT then press F3. (This creates a test paragraph.)
Edit → Find & Replace
Search for: steps → Replace with: & Ω → More options → Regular expressions → Replace All
Search for: Ω → Replace with: *** → Format → Size=16 → OK → Replace All
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, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).
AOO 4.1.7 Build 9800, MacOS 13.6.3, iMac Intel. The locale for any menus or Calc formulas in my posts is English (USA).