Eisbar Posted February 8, 2023 Posted February 8, 2023 I need to prepare a Publisher Document with hundrets of Endnotes (IDML-import) for online use.... With find&replace I can find every endnote by searching the textstyle "Endnote". But before and after every endnote I had to enter some textcomand. For example: This is1 a text.-> This is<endnote>1</endnote> a text. Is it possible to do this with find&replace? Finding is not the problem. But is it possible with RegEx to add text before and after the endnote? I just know that RegEx is a strong tool - but I don´t know to work with it 😞 Thx for help!! Quote
v_kyr Posted February 8, 2023 Posted February 8, 2023 Since APub has that Find & Replace panel, see therefor ... Find and Replace Find and Replace Panel ... try out in the replace text field to add a <before> and <after> text which then surrounds your find term. Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2
Eisbar Posted February 8, 2023 Author Posted February 8, 2023 <before> is not working.... any other ideas? Quote
v_kyr Posted February 8, 2023 Posted February 8, 2023 25 minutes ago, Eisbar said: <before> That was of course just meant as a placeholder for whatever you wanted to write there as a replace text. - So you say you can't add any text before the found endnote in a replace run? Quote ☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan ☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2
Eisbar Posted February 8, 2023 Author Posted February 8, 2023 17 minutes ago, v_kyr said: So you say you can't add any text before the found endnote in a replace run? that´s right 😞 Quote
Pyanepsion Posted February 8, 2023 Posted February 8, 2023 Hello, @Eisbar, If your note uses a format or style, simply replace the format or style with your sequence: Quote 6 cœurs, 12 processus - Windows 11 pro - 4K - DirectX 12 - Suite universelle Affinity (Affinity Publisher, Affinity Designer, Affinity Photo). ███ Mais je vous le demande, peut-on imaginer une police sans sérifs ?
Eisbar Posted February 8, 2023 Author Posted February 8, 2023 original text: "This is1 a text." what I need: ""This is<endnote>1</endnote> a text." Quote
walt.farrell Posted February 8, 2023 Posted February 8, 2023 9 minutes ago, Eisbar said: original text: "This is1 a text." what I need: ""This is<endnote>1</endnote> a text." But, do you need every 1 replaced that way? Or every is1 replaced? Or every occurrence of any word immediately followed by a 1 (with no space) replaced? Or any word immediately followed by a single digit? You need a general statement of the input and output text to construct a regular expression, not just one example. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
Eisbar Posted February 8, 2023 Author Posted February 8, 2023 every sign with the textstyle: "endnote" (just numbers, from 1 - n) has to get "<endnote> before the number and behind the number must be the text </endnote> walt.farrell 1 Quote
laurent32 Posted February 8, 2023 Posted February 8, 2023 You could try : search = your textstyle endnote replace = <endnote>$0</endnote> Quote MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82) + 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + … Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026) MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345) Licence Universelle Affinity V2 updated to 2.3.0
Old Bruce Posted February 8, 2023 Posted February 8, 2023 6 hours ago, Eisbar said: I need to prepare a Publisher Document with hundrets of Endnotes (IDML-import) for online use.... Not having access to the Adobe document means we can't really troubleshoot this. Are the note superscripted numbers actually 1, 2, 3 etc or are they markers? I don't know if IDML import converts the Markers to actual text or not. Are the Markers (1, 2, 3, etc) a separate Character Style or part of the overall Paragraph Style for the notes? Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that.
Eisbar Posted February 8, 2023 Author Posted February 8, 2023 Laurent32 - thx for your idea. I will try it later! And report... Old Bruce: The endnote are just superscripted numbers actually 1, 2, 3 (with a textstyle). They are not are part of a Paragraphstye - I mean they are text in a paragraph which has a style. But they have the textstyle by whom I can find very easy every endnote! Quote
Eisbar Posted February 8, 2023 Author Posted February 8, 2023 4 hours ago, laurent32 said: You could try : search = your textstyle endnote replace = <endnote>$0</endnote> this is not working 😞 the result is exactly this: "<endnote>$0</endnote>" Quote
walt.farrell Posted February 8, 2023 Posted February 8, 2023 13 minutes ago, Eisbar said: this is not working 😞 the result is exactly this: "<endnote>$0</endnote>" Please show us a screenshot of your Find and Replace panel in Publisher. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
Eisbar Posted February 8, 2023 Author Posted February 8, 2023 Here are 2 screenshots: before and after replacing. And for every case: a sample document.... 33_Obadija.afpub Quote
walt.farrell Posted February 8, 2023 Posted February 8, 2023 Thanks. You need something in the Find field if you're going to use $0, as otherwise you won't have a regular expression search. You can try using .* and see if it works. There are, however, some forum discussions about problems using that search term successfully. So it might not work. Perhaps, given that you're only looking for numbers, it would by better to try \d+ or \d+? instead. And, as another alternative if those don't work, you could try (\d+) in the find and then use $1 or \1 instead of $0 in the replace field. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
laurent32 Posted February 9, 2023 Posted February 9, 2023 You could try v2 : search = \d+ + your textstyle endnote replace = <endnote>$0</endnote> Quote MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82) + 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + … Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026) MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345) Licence Universelle Affinity V2 updated to 2.3.0
Eisbar Posted February 9, 2023 Author Posted February 9, 2023 Dear Laurent32, I am so grateful to you. It works - and you save me so much work! 1000 thanks!! laurent32 1 Quote
Eisbar Posted February 9, 2023 Author Posted February 9, 2023 I have one more challenge! All words or phrases in italic must be preceded by a <i> and followed by a </i>. I tried it with the regex "." This works insofar as it finds all characters that have the text attribute italic. But it is found letter by letter and each letter is preceded by an <i> and then a </i>. Is there an expression to tell publisher: all related words are to be considered as a unit? Quote
walt.farrell Posted February 9, 2023 Posted February 9, 2023 2 minutes ago, Eisbar said: I have one more challenge! All words or phrases in italic must be preceded by a <i> and followed by a </i>. I tried it with the regex "." This works insofar as it finds all characters that have the text attribute italic. But it is found letter by letter and each letter is preceded by an <i> and then a </i>. Is there an expression to tell publisher: all related words are to be considered as a unit? .*? would be one commmon way. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
laurent32 Posted February 9, 2023 Posted February 9, 2023 You could try : Search = \w+ + the style you're looking after Replace = <i>$0</i> Quote MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82) + 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + … Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026) MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345) Licence Universelle Affinity V2 updated to 2.3.0
Eisbar Posted February 9, 2023 Author Posted February 9, 2023 can I avoid this? see screenshot! Quote
laurent32 Posted February 9, 2023 Posted February 9, 2023 You can try, if you have a text style dedicated to italics : Search = empty + character style italics Replace = <i>$0</i> Quote MacBook Pro 16 pouces (3456 × 2234), 2021 / Apple M1 Pro / 16 Go / macOS Ventura Version 13.4.1 (22F82) + 31,5 pouces (2560 × 1440) + 27 pouces (1080 × 1920) + iPad (8th generation) / iPadOS 17.2 + Apple Pencil + … Macmini6,2 Quad-Core Intel Core i7 16 Go / macOS Catalina version 10.15.7 (19H2026) MacBookAir6,2 Intel Core i5 double cœur 4 Go / macOS Big Sur version 11.7.7 (20G1345) Licence Universelle Affinity V2 updated to 2.3.0
Old Bruce Posted February 9, 2023 Posted February 9, 2023 1 hour ago, Eisbar said: can I avoid this? see screenshot! You could then search for </i> <I> and replace with just the space. 4 hours ago, Eisbar said: All words or phrases in italic must be preceded by a <i> and followed by a </i>. It really depends if the spaces are also styled italic. As you said the text is coming in from an IDML file there is no guarantee that they are. If the spaces are italic then I would use for find: With the italic option from the silly little cog wheel's Format choice. (.+?) and then use the following for the replace: <I>\1</i> Quote Mac Pro (Late 2013) Mac OS 12.7.6 Affinity Designer 2.6.0 | Affinity Photo 2.6.0 | Affinity Publisher 2.6.0 | Beta versions as they appear. I have never mastered color management, period, so I cannot help with that.
walt.farrell Posted February 9, 2023 Posted February 9, 2023 2 hours ago, Eisbar said: can I avoid this? see screenshot! My version using .*? should not have that problem. Quote -- Walt Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases PC: Desktop: Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 Laptop: Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU. Laptop 2: Windows 11 Pro 24H2, 16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU iPad: iPad Pro M1, 12.9": iPadOS 18.3.1, Apple Pencil 2, Magic Keyboard Mac: 2023 M2 MacBook Air 15", 16GB memory, macOS Sequoia 15.0.1
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.